`
zhufengxiang
  • 浏览: 1720 次
  • 性别: Icon_minigender_1
  • 来自: 杭州
社区版块
存档分类
最新评论

hibernate中使用c3p0数据源

阅读更多

在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对象的数量

 

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics