- Utilizing database connection pooling services provided by the container, i.e. Tomcat uses Commons DBCP and Commons Pool as the implementation (tomcat-dbcp.jar).
- Externalizing database connection and make it independent from the web application itself.
- Sharing database connections across applications deployed in the container.
The following examples are tested in Tomcat 7 and MySQL Database 5.5.