diff --git a/projects/samskivert/src/java/com/samskivert/jdbc/jora/Cursor.java b/projects/samskivert/src/java/com/samskivert/jdbc/jora/Cursor.java index a3385bbe..dfe5aace 100644 --- a/projects/samskivert/src/java/com/samskivert/jdbc/jora/Cursor.java +++ b/projects/samskivert/src/java/com/samskivert/jdbc/jora/Cursor.java @@ -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 maxElements records from database and * store them into array. It is possible to extract rest records * by successive next() or toArray() calls. Selected objects should