title: Java - database connection management in connection pool
body: <p>For a programming class I am taking I want to design a connection pool. I have been reading up on the concept, but 1 thing sounds like a contradiction to me and that is how long a created connection stays open.</p>
  
  <p>If I understand it correctly a collection (pool) of Connections is created on application start up and requests can be made to obtain a connection. If the resource requesting the connection is done with its operations the connection is returned to this pool, but as far as I can tell it is never closed.</p>
  
  <p>When I read other articles I always read it is good practice to close connections as soon as possible and never leave them open.</p>
  
  <p>Is there any problem with keeping a connection open for the application lifetime? I know that the resultset and statement need to be cleared when recycling a connection, but any other objections to keeping a connection open?</p>
  
  <p>Many thanks for your input!</p>