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:
@@ -141,6 +141,21 @@ public class Cursor {
|
|||||||
// catch (SQLException ex) { session.handleSQLException(ex); }
|
// 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
|
/** Extracts no more than <I>maxElements</I> records from database and
|
||||||
* store them into array. It is possible to extract rest records
|
* store them into array. It is possible to extract rest records
|
||||||
* by successive next() or toArray() calls. Selected objects should
|
* by successive next() or toArray() calls. Selected objects should
|
||||||
|
|||||||
Reference in New Issue
Block a user