title: Closing a jdbc connection object when session expires
body: <p>I am creating a Connection object and making jdbc connection in a constructor of a class (DbTest).</p>
  
  <p>Then in another java class(RequestFilter.java), I am initializing this object and storing this instance object in HTTP Session,</p>
  
  <pre><code>DbTest dbtest = new DbTest();
  session.setAttribute("dbtest", dbtest);
  </code></pre>
  
  <p>My question is, is there a way to close the connection object that was created when the session expires? Or will it automatically get closed when it expires?</p>