If you want to make sure the connection is closed/release in any case, put
the close() call inside a finally clause:


  Connection connection = DatabaseManager.getConnection();
  try {
     ....//jdbc work.
  }
  finally {
    DatabaseManager.closeConnection(connection);
  }

This way, whatever happens inside the try block, you are sure
closeConnection will be called (think about an exception being thrown in
the try block...)


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to