C3P0的详细配置说明

转载地址

 c3p0.acquireIncrement=3 
 c3p0.initialPoolSize=3 
 c3p0.idleConnectionTestPeriod=900 
 c3p0.minPoolSize=2 
 c3p0.maxPoolSize=50 
 c3p0.maxStatements=100 
 c3p0.numHelperThreads=10 
 c3p0.maxIdleTime=600
 [](https://code.csdn.net/snippets/398998/fork)

  
 ${c3p0.acquireIncrement} 
  
  
 ${c3p0.initialPoolSize} 
  
  
 ${c3p0.minPoolSize} 
  
  
 ${c3p0.maxPoolSize} 
  
  
 ${c3p0.maxIdleTime} 
  
  
 ${c3p0.idleConnectionTestPeriod} 
  
  
 ${c3p0.maxStatements} 
  
  
 ${c3p0.numHelperThreads} 
 

下面详细介绍下配置说明:

       
   
   
  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 
   
   
   
   
   
   
   
   
   
   
   
   
   
   
   
   
  
########################### 
### 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

你可能感兴趣的:(C3P0的详细配置说明)