# C3P0 配置信息

**URL:** <https://www.isharkfly.com/t/c3p0/7102>\
**Category:** 程序语言\
**Created:** [December 3, 2014, 4:17pm UTC](https://www.isharkfly.com/t/c3p0/7102 "2014-12-03T16:17:13Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![honeymoose](https://www.isharkfly.com/user_avatar/www.isharkfly.com/honeymoose/32/20796_2.png) [@honeymoose](https://www.isharkfly.com/u/honeymoose)\
**Post date:** [December 3, 2014, 4:17pm UTC](https://www.isharkfly.com/t/c3p0/7102/1 "2014-12-03T16:17:13Z")

</div>

3

30

1000

false

Test

false

100

null

false

60

3

60

15

100

3

root

password

select id from test where id=1

300

false

true

root

在Hibernate（spring管理）中的配置：  
  
oracle.jdbc.driver.OracleDriver  
jdbc:oracle:thin:@localhost:1521:Test  
Kay  
root

编辑本段相关信息连接池配置（以Hibernate为例）  
###########################

### C3P0 Connection Pool###

###########################  
#hibernate.c3p0.max\_size 2  
#hibernate.c3p0.min\_size 2  
#hibernate.c3p0.timeout 5000  
#hibernate.c3p0.max\_statements 100  
#hibernate.c3p0.idle\_test\_period 3000  
#hibernate.c3p0.acquire\_increment 2  
#hibernate.c3p0.validate false

在hibernate.cfg.xml文件里面加入如下的配置：

20

5

120

100

120

2

true
