public void beforeFirst() throws SQLException { checkScrollable(); if (!rows.isEmpty()) { current_row = -1; } onInsertRow = false; this_row = null; rowBuffer = null; }
public void afterLast() throws SQLException { checkScrollable(); final int rows_size = rows.size(); if (rows_size > 0) { current_row = rows_size; } onInsertRow = false; this_row = null; rowBuffer = null; }
public boolean first() throws SQLException { checkScrollable(); if (rows.size() <= 0) { return false; } current_row = 0; initRowBuffer(); onInsertRow = false; return true; }
public boolean last() throws SQLException { checkScrollable(); final int rows_size = rows.size(); if (rows_size <= 0) { return false; } current_row = rows_size - 1; initRowBuffer(); onInsertRow = false; return true; }
public boolean relative(int rows) throws SQLException { checkScrollable(); if (onInsertRow) { throw new PSQLException(GT.tr("Can''t use relative move methods while on the insert row."), PSQLState.INVALID_CURSOR_STATE); } // have to add 1 since absolute expects a 1-based index return absolute(current_row + 1 + rows); }
public void setFetchDirection(int direction) throws SQLException { checkClosed(); switch (direction) { case ResultSet.FETCH_FORWARD: break; case ResultSet.FETCH_REVERSE: case ResultSet.FETCH_UNKNOWN: checkScrollable(); break; default: throw new PSQLException(GT.tr("Invalid fetch direction constant: {0}.", direction), PSQLState.INVALID_PARAMETER_VALUE); } this.fetchdirection = direction; }
public boolean previous() throws SQLException { checkScrollable(); if (onInsertRow) { throw new PSQLException(GT.tr("Can''t use relative move methods while on the insert row."), PSQLState.INVALID_CURSOR_STATE); } if (current_row - 1 < 0) { current_row = -1; this_row = null; rowBuffer = null; return false; } else { current_row--; } initRowBuffer(); return true; }
public boolean absolute(int index) throws SQLException { checkScrollable();