1. 程式人生 > >spring配置dbcp連線池

spring配置dbcp連線池

<bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource">
  <property name="username" value="${connection.username}"></property>
  <property name="password" value="${connection.password}"></property>
  <property name="url" value="${connection.url}"></property>
  <property name="driverClassName" value="${connection.driverClassName}"></property>
  <!-- <property name="initialSize" value="${connection.initialSize}"></property> -->
  <property name="maxActive" value="${connection.maxActive}"></property>
  <property name="maxIdle" value="${connection.maxIdle}"></property>
  <property name="minIdle" value="${connection.minIdle}"></property>
  <property name="maxWait" value="${connection.maxWait}"></property>
  <property name="removeAbandoned" value="${connection.removeAbandoned}"></property>
  <property name="removeAbandonedTimeout" value="${connection.removeAbandonedTimeout}"></property>
  <property name="logAbandoned" value="${connection.logAbandoned}"></property>
 </bean>