title: JDBC connection pool management
body: <p>I'm using <code>org.apache.commons.dbcp.BasicDataSource</code> as my datasource implementation, my code geting connection and closing the connection like this:</p>
  
  <pre><code>Connection conn = dataSource.getConnection();
  </code></pre>
  
  <p>when I finished the connection work I will close it</p>
  
  <pre><code>conn.close();
  </code></pre>
  
  <p>My question is: the <code>conn.close()</code> is really close, so when the connection be closed like <code>conn.close()</code>, how is datasource doing. I heard that the datasource connection close is not really close, just is release, but I can't find the release API from datasource class. I want to know how does datasource manage the creation, close and release of database connection.</p>
  
  <p>By the way a little question: how does datasource refresh the connection, I mean if the connections of the datasource haven't been used for one year, how does datasource keep the connections available?</p>