DriverManagerDataSource srping的
<bean id="dataSource"
class="org.springframework.jdbc.datasource.DriverManagerDataSource">
<property name="driverClassName" value="${jdbc.driverClassName}" />
<property name="url" value="${jdbc.url.bofdb}" />
<property name="username" value="${jdbc.username.bof}" />
<property name="password" value="${jdbc.password.bof}" />
</bean>
BasicDataSource apache的
<bean id="oneByOneDataSource" class="org.apache.commons.dbcp.BasicDataSource"
destroy-method="close">
<property name="driverClassName" value="com.ibm.db2.jcc.DB2Driver" />
<property name="url" value="${jdbc.url.bofdb}" />
<property name="username" value="${jdbc.username.bof}" />
<property name="password" value="${jdbc.password.bof}" />
<property name="initialSize" value="10" />
<property name="maxActive" value="30" />
<property name="maxWait" value="10000" />
</bean>
BasicDataSource 是有连接池的,spring默认的DriverManagerDataSource是没有连接池的。
maven配置BasicDataSource
<dependency>
<groupId>commons-dbcp</groupId>
<artifactId>commons-dbcp</artifactId>
<version>1.4</version>
</dependency>