A generic DBCP connection pool Spring bean

/ Published in: XML
Save to your folder(s)

Copy this code and paste it in your HTML
  1. <bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource" destroy-method="close">
  2. <property name="driverClassName" value="${db.driver}"/>
  3. <property name="url" value="${db.url}"/>
  4. <property name="username" value="${db.username}"/>
  5. <property name="password" value="${db.password}"/>
  6. <property name="maxIdle" value="10"/>
  7. <property name="maxActive" value="100"/>
  8. <property name="maxWait" value="10000"/>
  9. <property name="validationQuery" value="select 1"/>
  10. <property name="testOnBorrow" value="false"/>
  11. <property name="testWhileIdle" value="true"/>
  12. <property name="timeBetweenEvictionRunsMillis" value="1200000"/>
  13. <property name="minEvictableIdleTimeMillis" value="1800000"/>
  14. <property name="numTestsPerEvictionRun" value="5"/>
  15. <property name="defaultAutoCommit" value="false"/>
  16. </bean>

URL: http://commons.apache.org/dbcp/configuration.html

Report this snippet


RSS Icon Subscribe to comments

You need to login to post a comment.