I want to use Connection pooling in my java web application with MySQL and JDBC, I found a very resource to learn at Apache Tomcat 6.0 (6.0.35) - JNDI Datasource HOW-TO,
But this example uses JSTL code to explain how to retrieve connection from pool. I want to work similarly but with a MVC architecture from scratch consisting of Beans, DAOs, Servlets and JSPs. I got everything I want from a very good DAO tutorial by BalusC but I am confused in the last part of tutorial saying How about Connection Pooling?. Could anyone please elaborate on this connection pooling topic and the close()
method?
EDIT:
Actually i should have add this thing earlier also:
As the tutorial I have linked above comes before JDK7, which now has try-wth-resource code that closes the Connection
automatically, then how can we maintain a Connection pool and closing a Connection in pool here with the same DAO code (or with few changes) as in the tutorial?