title: Spring JdbcTemplate ConnectionPooling Configuration
body: <p>I am working on a Spring MVC application in which I have recently been convinced to revamp my database code. Before I was using very traditional JDBC code that I have been told was very "old school" because of the boilerplate code. I have been making the transition to using <b>JdbcTemplate</b> with Spring.</p>
  
  <p>I have configured a bean like shown below in my <b>applicationContext.xml</b> file.</p>
  
  <pre><code>&lt;bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource"&gt;
      &lt;property name="driverClassName" value="com.mysql.jdbc.Driver"/&gt;
      &lt;property name="url" value="jdbc:ip-address:port/dbName"/&gt;
      &lt;property name="username" value="myUsername"/&gt;
      &lt;property name="password" value="mypassword"/&gt;
  &lt;/bean&gt;
  </code></pre>
  
  <p>I have run tests just to make sure everything is working and it is.</p>
  
  <p>My question is, I am aware that I am using the <b>Commons DBCP</b> package which uses the 
  following packages</p>
  
  <pre><code> commons-dbcp package
   commons-pool package
  </code></pre>
  
  <p>Again, I am very inexperienced with this, so I apologize if I am mis referencing something or am explaining something incorrectly.</p>
  
  <p>I have followed what most of the tutorials have said to do and specified a jdbcTemplate and injected the dataSource bean into it, but this doesnt really refer to my question.</p>
  
  <p><b>
  What I would really like to know is, am I using ConnectionPooling with this configuration?</p>
  
  <p>If so, is it being done behind the scenes, or do I need to specify to do it somewhere?</p>
  
  <p></b></p>
  
  <p>I have looked at the documentation at <a href="http://commons.apache.org/dbcp/index.html" rel="nofollow">Here</a> which gives the following, but I am not sure exactly how to interpret it.</p>
  
  <p>"here are several Database Connection Pools already available, both within Apache products and elsewhere. This Commons package provides an opportunity to coordinate the efforts required to create and maintain an efficient, feature-rich package under the ASF license.
  The commons-dbcp package relies on code in the commons-pool package to provide the underlying object pool mechanisms that it utilizes."</p>
  
  <p>I also looked at the <a href="http://commons.apache.org/dbcp/configuration.html" rel="nofollow">Configuration Page</a></p>
  
  <p>and based on this page, I would think that I am able to do ConnectionPooling, but may need to specify additional parameters in my <b>dataSource</b> bean.</p>
  
  <p>Can somebody please answer my questions or point me in the right direction?</p>