Spring与Hibernate的整合applicationContext.xml中配置

本文详细介绍了如何在Spring的applicationContext.xml中配置Hibernate,实现两者的无缝集成。内容包括SessionFactory的创建、DataSource的配置、HibernateTemplate的使用及相关依赖声明等关键步骤。
摘要由CSDN通过智能技术生成
1、资源文件resources.properties中内容

hibernate.dialect=org.hibernate.dialect.MySQLInnoDBDialect
hibernate.hbm2ddl.auto=none
hibernate.show_sql=true
hibernate.query.substitutions=true 1, false 0
hibernate.default_batch_fetch_size=16
hibernate.max_fetch_depth=2
hibernate.bytecode.use_reflection_optimizer=true
hibernate.cache.use_second_level_cache=true
hibernate.cache.use_query_cache=true
hibernate.cache.region.factory_class=org.hibernate.cache.EhCacheRegionFactory
net.sf.ehcache.configurationResourceName=/ehcache_hibernate.xml
hibernate.cache.use_structured_entries=true
hibernate.generate_statistics=true


connection.driver_class=com.mysql.jdbc.Driver
connection.url=jdbc\:mysql\://192.168.1.27\:3320/emcc_db?useUnicode\=true&characterEncoding\=UTF-8
connection.username=root
connection.password=123456

proxool.maximum.connection.count=10
proxool.minimum.connection.count=5
proxool.statistics=1m,15m,1h,1d
proxool.simultaneous.build.throttle=30
name=admin
password=admin

2、applicationContext.xml中配置
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值