Database pooling with Apache Tomcat JDBC Pool

This will go through configuring database pooling on Apache Tomcat

Download

Download the jar from:
http://people.apache.org/~fhanik/jdbc-pool/

Add to Maven

mvn.bat install:install-file \
-DgroupId=org.apache.tomcat \
-DartifactId=jdbc-pool \
-Dversion=1.0.8.5 \
-Dpackaging=jar -Dfile=tomcat-jdbc.jar \
-Dmaven.repo.local=D:\Programs\Maven\Repository\repository

Dependencies

org.apache.tomcat.juli

Add to applicationContext

<bean id="dataSource" class="org.apache.tomcat.jdbc.pool.DataSource" destroy-method="close">
<property name="driverClassName" value="drivername"/>
<property name="url" value="jdbc://...."/>
<property name="username" value="username"/>
<property name="password" value="password"/>
<property name="timeBetweenEvictionRunsMillis" value="5000"/>
<property name="minEvictableIdleTimeMillis" value="5000"/>
<property name="minIdle" value="0"/>
</bean>

References

Configuring JDBC Pool
Instructions on use
Production Ready Tomcat . Optimizations, Security aspects
Configuring JDBC-Pool