c3p0数据连接池更换为druid

参考:

Druid 介绍及配置

http://www.cnblogs.com/niejunlei/p/5977895.html

配置_DruidDataSource参考配置

https://github.com/alibaba/druid/wiki/%E9%85%8D%E7%BD%AE_DruidDataSource%E5%8F%82%E8%80%83%E9%85%8D%E7%BD%AE

阿里巴巴-德鲁伊druid连接池配置

http://blog.csdn.net/archer119/article/details/51771671


pom.xml文件中加入依赖

 
 
    com.alibaba 
    druid 
    1.1.1 
 

修改spring中的连接池配置

web.xml中添加

	  
	    
	     
	     
	     
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		  
	

db-config.properties

url=jdbc:mysql://xx.xx.xx.xx:3306
user=
password=
driverClassName=com.mysql.jdbc.Driver
filters=stat
maxActive=20
initialSize=1
maxWait=60000
minIdle=10
maxIdle=15
timeBetweenEvictionRunsMillis=60000
minEvictableIdleTimeMillis=300000
validationQuery=SELECT 'x'
testWhileIdle=true
testOnBorrow=false
testOnReturn=false
maxOpenPreparedStatements=20
removeAbandoned=true
removeAbandonedTimeout=1800
logAbandoned=true

web.xml中添加

     
        DruidStatView  
        com.alibaba.druid.support.http.StatViewServlet  
      
      
        DruidStatView  
        /druid/*  
     

配置修改完成


为Druid监控配置访问权限(配置访问监控信息的用户与密码)

http://blog.csdn.net/renfufei/article/details/39553639


你可能感兴趣的:(其它)