标签:apach pad cdata org root common 1.2 value dbcp连接池
1. 管理DBCP连接池
* 先引入DBCP的2个jar包
* com.springsource.org.apache.commons.dbcp-1.2.2.osgi.jar
* com.springsource.org.apache.commons.pool-1.5.3.jar
* 编写配置文件
<bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource">
<property name="driverClassName" value="com.mysql.jdbc.Driver"/>
<property name="url" value="jdbc:mysql:///spring_day03"/>
<property name="username" value="root"/>
<property name="password" value="root"/>
</bean>
2. 管理C3P0连接池
* 先引入C3P0的jar包
* com.springsource.com.mchange.v2.c3p0-0.9.1.2.jar
* 编写配置文件
<bean id="dataSource" class="com.mchange.v2.c3p0.ComboPooledDataSource">
<property name="driverClass" value="com.mysql.jdbc.Driver"/>
<property name="jdbcUrl" value="jdbc:mysql:///spring_day03"/>
<property name="user" value="root"/>
<property name="password" value="root"/>
</bean>
标签:apach pad cdata org root common 1.2 value dbcp连接池
原文地址:http://www.cnblogs.com/rookie-newbie/p/7930144.html