Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.
465 Like other JDBC interfaces, ResultSet also provides the close method that you should call as soon as you are done with a ResultSet object. Closing JDBC Objects You should always close all JDBC objects after use by calling their close methods. In an application that employs a connection pool, forgetting to close a Connection will cause the it not to be returned to the pool for reuse. In addition, you should call close properly. Here is an unsafe way of calling close. resultSet.close(); statement.close(); connection.close(); This method is not perfect because resultSet.close() and statement.close()