Thursday, May 5, 2011

Close ResultSet, PreparedStatement, Connection Properly in Java

It is good to close the following in order properly
1. ResultSet
2. PreparedStatement
3. Connection

http://stackoverflow.com/questions/2363785/which-should-i-close-first-the-preparedstatement-or-the-connection

Or use the Common DBUtils class by Apache
http://commons.apache.org/dbutils/examples.html

No comments: