com.jolbox.bonecp.provider.BoneCPConnectionProvider ${driverClass} ${jdbcUrl} ${username} ${password} ${hibernate.dialect} ${hibernate.show_sql} ${hibernate.format_sql} ${hibernate.hbm2ddl.auto} ${hibernate.cache.use_second_level_cache} ${hibernate.cache.use_query_cache} ${idleMaxAge} ${idleConnectionTestPeriod} ${partitionCount} ${acquireIncrement} ${maxConnectionsPerPartition} ${minConnectionsPerPartition} ${statementsCacheSize} ${releaseHelperThreads}
WEB-INF/conf/hibernate
properties配置文件
# 数据库连接驱动driverClass=com.mysql.jdbc.Driver# 数据库路径jdbcUrl=jdbc:mysql://127.0.0.1:3306/gameserver?useUnicode=true&characterEncoding=UTF-8# 数据库用户名username=root# 数据库密码password=root# 检查数据库连接池中空闲连接的间隔时间idleConnectionTestPeriod=60# 连接池中未使用的链接最大存活时间idleMaxAge=240# 设置每个分区含有connection最大个数maxConnectionsPerPartition=60# 设置每个分区含有connection最小个数minConnectionsPerPartition=20# 设置每个分区数partitionCount=3# 设置分区中的connection增长数量acquireIncrement=5# 设置连接池阀值poolAvailabilityThreshold=10# 连接时间connectionTimeout=3000# 每个分区释放链接助理进程的数量,默认值:3,除非你的一个数据库连接的时间内做了很多工作,不然过多的助理进程会影响你的性能 --> releaseHelperThreads=3# 缓存prepared statements的大小,默认值:0 statementsCacheSize=30# hibernate配置方法hibernate.hbm2ddl.auto=truehibernate.show_sql=falsehibernate.format_sql=falsehibernate.cache.use_second_level_cache=truehibernate.cache.use_query_cache=falsehibernate.ehcache_config_file=/ehcache/ehcache-hibernate-local.xmlhibernate.dialect=org.hibernate.dialect.MySQLDialecthibernate.cache.provider_class=org.hibernate.cache.EhCacheProvider
(作者:LeeHonGee)