title: Setup Connection pooling in jsp/servlets application based on MVC?
body: <p>I want to use Connection pooling in my java web application with MySQL and JDBC, I found a very resource to learn at <a href="http://tomcat.apache.org/tomcat-6.0-doc/jndi-datasource-examples-howto.html#MySQL_DBCP_Example" rel="nofollow">Apache Tomcat 6.0 (6.0.35) - JNDI Datasource HOW-TO</a>,
  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 <a href="http://balusc.blogspot.in/2008/07/dao-tutorial-data-layer.html" rel="nofollow">DAO tutorial</a> by BalusC but I am confused in the last part of tutorial saying <a href="http://balusc.blogspot.in/2008/07/dao-tutorial-data-layer.html#HowAboutConnectionPooling" rel="nofollow">How about Connection Pooling?</a>. Could anyone please elaborate on this connection pooling topic and the <code>close()</code> method?</p>
  
  <p><strong>EDIT:</strong><br/>
  Actually i should have add this thing earlier also:<br/>
  As the tutorial I have linked above comes before JDK7, which now has try-wth-resource code that closes the <code>Connection</code> automatically, then how can we maintain a Connection pool and closing a Connection in pool here with the same DAO code <em>(or with few changes)</em> as in the tutorial?</p>