title: DB connection pool getting exhausted -- Java
body: <p>I am using Connection Pool (snaq.db.ConnectionPool) in my application. The connection pool is initialized like:</p>
  
  <pre><code>String dburl = propertyUtil.getProperty("dburl");
  String dbuserName = propertyUtil.getProperty("dbuserName");
  String dbpassword = propertyUtil.getProperty("dbpassword");
  String dbclass = propertyUtil.getProperty("dbclass");
  String dbpoolName = propertyUtil.getProperty("dbpoolName");
  int dbminPool = Integer.parseInt(propertyUtil.getProperty("dbminPool"));
  int dbmaxPool = Integer.parseInt(propertyUtil.getProperty("dbmaxPool"));
  int dbmaxSize = Integer.parseInt(propertyUtil.getProperty("dbmaxSize"));
  long dbidletimeout = Long.parseLong(propertyUtil.getProperty("dbidletimeout"));
  Class.forName(dbclass).newInstance();
  ConnectionPool moPool = new ConnectionPool(dbpoolName, dbminPool, dbmaxPool, dbmaxSize,
  dbidletimeout, dburl, dbuserName, dbpassword);
  </code></pre>
  
  <p>DB Pool values used are: </p>
  
  <pre><code>dbminPool=5
  dbmaxPool=30
  dbmaxSize=30
  dbclass=org.postgresql.Driver
  dbidletimeout=25
  </code></pre>
  
  <p>My application was leaking connection somewhere (connection was not released) and due to which the connection pool was getting exhausted. I have fixed that code for now.</p>
  
  <p><strong>Shouldn't the connections be closed after idle timeout period</strong>? If that is not correct assumption, Is there any way to <strong>close the open idle connections</strong> anyway (through java code only)?</p>