参考:http://www.cnblogs.com/200911/archive/2012/08/10/2631760.html
Spring对数据源的实现有三种,下面是在applicationContext.xml中数据源的配置。
(1)ComboPooledDataSource连接池--->需要有c3p0的包
db.properties:
jdbc.jdbcUrl=jdbc:mysql:///hibernate
jdbc.driverClass=com.mysql.jdbc.Driver
jdbc.user=root
jdbc.password=mysql
(2)BasicDataSource连接池----->需要commons-dbcp.jar、commons-pool.jar包
db.properties:
jdbc.url=jdbc:mysql:///springmvc
jdbc.driverClassName=com.mysql.jdbc.Driver
jdbc.username=root
jdbc.password=mysql
(3)DruidDataSource连接池----->需要druid包