Chinaunix首页 | 论坛 | 博客
  • 博客访问: 814161
  • 博文数量: 247
  • 博客积分: 166
  • 博客等级: 入伍新兵
  • 技术积分: 2199
  • 用 户 组: 普通用户
  • 注册时间: 2012-11-15 16:10
文章分类

全部博文(247)

文章存档

2017年(1)

2015年(63)

2014年(80)

2013年(94)

2012年(9)

分类: Java

2014-02-25 21:53:03

C3P0是一个开放源代码的JDBC连接池,它在lib目录中与Hibernate一起发布,包括了实现jdbc3和jdbc2扩展规范说明的Connection 和Statement 池的DataSources 对象。 


 
 
 


 
30 

 
1000 

 
false 

 
Test 

 
false 

 
100 

 
 

 
null 

 
false 

 
60 

 


 
60 

 
15 

 
100 

 
 

 


 
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
阅读(879) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~