在hibernate.cfg.xml中添加c3p0配置。
<property name="hibernate.c3p0.max_size">10</property> 最大连接数
<property name="hibernate.c3p0.min_size">4</property> 最小连接数
<property name="hibernate.c3p0.acquire_increment">2</property> 一次增加多少连接数
<property name="hibernate.c3p0.timeout">5000</property> 连接多少时间没用就销毁
<property name="hibernate.c3p0.idle_test_period">5000</property> 检测线程多少时间检测一次连接以销毁没用的连接
<property name="hibernate.c3p0.max_statements">10</property> 缓存statement对象的数量
<property name="hibernate.c3p0.min_size">4</property> 最小连接数
<property name="hibernate.c3p0.acquire_increment">2</property> 一次增加多少连接数
<property name="hibernate.c3p0.timeout">5000</property> 连接多少时间没用就销毁
<property name="hibernate.c3p0.idle_test_period">5000</property> 检测线程多少时间检测一次连接以销毁没用的连接
<property name="hibernate.c3p0.max_statements">10</property> 缓存statement对象的数量
相关推荐
c3p0Jar包,Hibernate配置数据源必备,包含xml配置文件
博文链接:https://wxinpeng.iteye.com/blog/203110
博文链接:https://wxinpeng.iteye.com/blog/203088
hibernate4使用c3p0数据源所依赖的jar包 包含资源: c3p0-0.9.2.1.jar hibernate-c3p0-4.2.21.Final.jar mchange-commons-java-0.2.3.4.jar
一个hibernate数据源的c3p0配置,希望对你有帮助
博文链接:https://wxinpeng.iteye.com/blog/203093
C3P0是一个开源的JDBC连接池...C3P0数据源在项目开发中使用得比较多。导入相关jar包c3p0-0.9.2-pre1.jar、mchange-commons-0.2.jar,如果操作的是Oracle数据库,那么还需要导入c3p0-oracle-thin-extras-0.9.2-pre1.jar
SSH整合学习笔记之struts2+spring+hibernate+c3p0源码
hibernate c3p0数据源 所需 3个jar包。3个资源只要1分,在这下载保证安全
博文链接:https://wxinpeng.iteye.com/blog/203114