spring4.x dbcp,dbcp2连接池基本配置BasicDataSource

阅读更多

 

一、dbcp

spring配置文件



	
		
			classpath:jdbc.properties
		
	




	
	
	
	
	
	
	
	
	
	
	
	
	
	

 jdbc.properties

#dbcp
driverClassName=com.mysql.jdbc.Driver
url=jdbc:mysql://localhost:3306/uplatEui?useUnicode=true&characterEncoding=utf-8
username=root
password=password

maven pom.xml


    commons-dbcp
    commons-dbcp
    1.4

 

二、dbcp2

dbcp2需要jdk1.7,否则会报错:Unsupported major.minor version 51.0

maxActive改为了maxTotal

spring配置文件



	
	
	
	
	
	
	
	
	
	
	
	

maven pom.xml


    org.apache.commons
    commons-dbcp2
    2.1.1

 

spring4.x c3p0连接池基本配置ComboPooledDataSource
http://happyqing.iteye.com/blog/2303239

 

spring4.x jdbcTemplate配置,事务配置
http://happyqing.iteye.com/blog/2303240

你可能感兴趣的:(spring,dbcp,连接池,BasicDataSource,配置)