proxoolConfig.properties文件的内容如下:
jdbc-0.proxool.alias=proxoolPool
jdbc-0.proxool.driver-class=com.microsoft.jdbc.sqlserver.SQLServerDriver
jdbc-0.proxool.driver-url=jdbc:microsoft:sqlserver://127.0.0.1:1433;DatabaseName=estate_0614;SelectMethod=cursor
jdbc-0.user=sa
jdbc-0.password=sa
jdbc-0.proxool.maximum-connection-count=100
jdbc-0.proxool.house-keeping-sleep-time=90000
jdbc-0.proxool.maximum-new-connections=20
jdbc-0.proxool.prototype-count=4
jdbc-0.proxool.minimum-connection-count=5
jdbc-0.proxool.verbose=true
jdbc-0.proxool.statistics=10s,1m,1d
jdbc-0.proxool.statistics-log-level=ERROR
hibernate.cfg.xml文件增加如下配置:
<property name="proxool.pool_alias">proxoolPool</property>
<property name="proxool.properties">proxoolConfig.properties</property>
<property name="connection.provider_class">
org.hibernate.connection.ProxoolConnectionProvider
</property>
jdbc-0.proxool.alias=proxoolPool
jdbc-0.proxool.driver-class=com.microsoft.jdbc.sqlserver.SQLServerDriver
jdbc-0.proxool.driver-url=jdbc:microsoft:sqlserver://127.0.0.1:1433;DatabaseName=estate_0614;SelectMethod=cursor
jdbc-0.user=sa
jdbc-0.password=sa
jdbc-0.proxool.maximum-connection-count=100
jdbc-0.proxool.house-keeping-sleep-time=90000
jdbc-0.proxool.maximum-new-connections=20
jdbc-0.proxool.prototype-count=4
jdbc-0.proxool.minimum-connection-count=5
jdbc-0.proxool.verbose=true
jdbc-0.proxool.statistics=10s,1m,1d
jdbc-0.proxool.statistics-log-level=ERROR
hibernate.cfg.xml文件增加如下配置:
<property name="proxool.pool_alias">proxoolPool</property>
<property name="proxool.properties">proxoolConfig.properties</property>
<property name="connection.provider_class">
org.hibernate.connection.ProxoolConnectionProvider
</property>
本文详细介绍了Proxool连接池的配置方法,包括proxoolConfig.properties文件的具体设置,以及如何在hibernate.cfg.xml中引用这些配置。通过调整参数如最大连接数、保持连接检查时间等,可以有效提高数据库访问效率。
952

被折叠的 条评论
为什么被折叠?



