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
I think this is a classic java question: Pass by
reference or by value. I have a DatabaseManager class
which takes care of get conection from connection pool
and release the connectoin. I am not sure about the
release part. Here is my code:
class MyMainClass
public static final void
Johansen
ETC ElectricTimeCar
-Opprinnelig melding-
Fra: Tony Smith [mailto:[EMAIL PROTECTED]
Sendt: 23. juli 2005 23:19
Til: Tomcat Users List
Emne: close pooled conection-by value or by reference
I think this is a classic java question: Pass by
reference or by value. I have a DatabaseManager
connection.isClosed() should return a boolean telling you whether or not
the connection was released.
On Sat, 2005-07-23 at 14:18 -0700, Tony Smith wrote:
I think this is a classic java question: Pass by
reference or by value. I have a DatabaseManager class
which takes care of get conection