/** INTERNAL. Close and old result set if there is still one open. */ protected void closeOldResultSet() throws SQLException { try { if (!closedByResultSet) { if (resultSet != null) { resultSet.closeInternal(); } } } finally { resultSet = null; updateCount = -1; } }
/** * Returns the last result set produces by this statement. * * @return the result set */ public ResultSet getResultSet() throws SQLException { try { checkClosed(); if (resultSet != null) { int id = resultSet.getTraceId(); debugCodeAssign("ResultSet", TraceObject.RESULT_SET, id, "getResultSet()"); } else { debugCodeCall("getResultSet"); } return resultSet; } catch (Exception e) { throw logAndConvert(e); } }
/** * Move to the next result set. This method always returns false. * * @param current Statement.CLOSE_CURRENT_RESULT, Statement.KEEP_CURRENT_RESULT, or * Statement.CLOSE_ALL_RESULTS * @return false */ public boolean getMoreResults(int current) throws SQLException { try { debugCodeCall("getMoreResults", current); switch (current) { case Statement.CLOSE_CURRENT_RESULT: case Statement.CLOSE_ALL_RESULTS: if (resultSet != null) { resultSet.close(); } break; case Statement.KEEP_CURRENT_RESULT: // nothing to do break; default: throw Message.getInvalidValueException("" + current, "current"); } return false; } catch (Exception e) { throw logAndConvert(e); } }