Added a close() method so that we can explicitely close free the resources

used internally to the Cursor without having to read each object.


git-svn-id: https://samskivert.googlecode.com/svn/trunk@1715 6335cc39-0255-0410-8fd6-9bcaacd3b74c
This commit is contained in:
ray
2005-09-13 02:16:03 +00:00
parent d793e90aec
commit a4cd2d533b
@@ -141,6 +141,21 @@ public class Cursor {
// catch (SQLException ex) { session.handleSQLException(ex); }
}
/**
* Close the Cursor, even if we haven't read all the possible
* objects.
*/
public void close ()
throws SQLException
{
if (stmt != null) {
stmt.close(); // also automatically closes result
result = null;
stmt = null;
}
nTables = 0;
}
/** Extracts no more than <I>maxElements</I> records from database and
* store them into array. It is possible to extract rest records
* by successive next() or toArray() calls. Selected objects should