It seems there is a lot of confusion between these two connection pooling libraries. What I want to know is which one is better (if at all)?
Here are some points whi
Tomcat 7 continues to use DBCP. The main reason could be hidden in their Tomcat docs:
The Apache Commons DBCP can be configured to track and recover these abandoned database connections. Not only can it recover them, but also generate a stack trace for the code which opened these resources and never closed them.
Tomcat jdbc-pool library, maybe faster in highly concurrent scenarios but cannot close and release statements automatically (which a developer has forgotten to close) resulting in possible memory leaks in some jdbc drivers.
However one of the problems with DBCP code is the delegation model they use, currently their latest versions supports JDK1.6 and lower. To support 1.7 means changing at least a fourth of their classes, which was one of the reasons JDBC pool library came to existence.
NOTE: Upon further investigation, JDBC pool does have a way of closing opening statements when a connection is closed, using a StatementFinalizer interceptor.