rowCnt = (res instanceof LazyResult) ? -1 : res.getRowCount(); cols = res.getVisibleColumnCount();
@Override public ResultInterface query(int maxrows) { recompileIfRequired(); setProgress(DatabaseEventListener.STATE_STATEMENT_START); start(); prepared.checkParameters(); ResultInterface result = prepared.query(maxrows); prepared.trace(startTimeNanos, result.isLazy() ? 0 : result.getRowCount()); setProgress(DatabaseEventListener.STATE_STATEMENT_END); return result; }
checkClosed(); if (rowNumber < 0) { rowNumber = result.getRowCount() + rowNumber + 1;
int state = getState(old); transfer.writeInt(state).writeInt(columnCount); int rowCount = result.getRowCount(); transfer.writeInt(rowCount); for (int i = 0; i < columnCount; i++) { int columnCount = generatedKeys.getVisibleColumnCount(); transfer.writeInt(columnCount); int rowCount = generatedKeys.getRowCount(); transfer.writeInt(rowCount); for (int i = 0; i < columnCount; i++) {
private void checkOnValidRow() throws SQLException { if (result.getRowId() < 0 || result.getRowId() >= result.getRowCount()) { throw Message.getSQLException(ErrorCode.NO_DATA_AVAILABLE); } }
private void checkOnValidRow() { if (result.getRowId() < 0 || result.getRowId() >= result.getRowCount()) { throw DbException.get(ErrorCode.NO_DATA_AVAILABLE); } }
private void checkOnValidRow() { if (result.getRowId() < 0 || result.getRowId() >= result.getRowCount()) { throw DbException.get(ErrorCode.NO_DATA_AVAILABLE); } }
/** * Checks if the current position is the last row, that means next() was * called and did not yet returned false, but will in the next call. * * @return if the current position is the last row * @throws SQLException if the result set is closed */ public boolean isLast() throws SQLException { try { debugCodeCall("isLast"); checkClosed(); int row = result.getRowId(); return row >= 0 && row == result.getRowCount() - 1; } catch (Throwable e) { throw logAndConvert(e); } }
/** * Checks if the current position is row 1, that means next() was called * once and returned true. * * @return if the current position is the first row * @throws SQLException if the result set is closed */ @Override public boolean isFirst() throws SQLException { try { debugCodeCall("isFirst"); checkClosed(); int row = result.getRowId(); return row == 0 && row < result.getRowCount(); } catch (Exception e) { throw logAndConvert(e); } }
/** * Checks if the current position is row 1, that means next() was called * once and returned true. * * @return if the current position is the first row * @throws SQLException if the result set is closed */ @Override public boolean isFirst() throws SQLException { try { debugCodeCall("isFirst"); checkClosed(); int row = result.getRowId(); return row == 0 && row < result.getRowCount(); } catch (Exception e) { throw logAndConvert(e); } }
/** * Checks if the current position is the last row, that means next() was * called and did not yet returned false, but will in the next call. * * @return if the current position is the last row * @throws SQLException if the result set is closed */ @Override public boolean isLast() throws SQLException { try { debugCodeCall("isLast"); checkClosed(); int row = result.getRowId(); return row >= 0 && row == result.getRowCount() - 1; } catch (Exception e) { throw logAndConvert(e); } }
/** * Checks if the current position is after the last row, that means next() * was called and returned false. * * @return if the current position is after the last row * @throws SQLException if the result set is closed */ public boolean isAfterLast() throws SQLException { try { debugCodeCall("isAfterLast"); checkClosed(); int row = result.getRowId(); int count = result.getRowCount(); return row >= count || count == 0; } catch (Throwable e) { throw logAndConvert(e); } }
/** * Checks if the current position is row 1, that means next() was called * once and returned true. * * @return if the current position is the first row * @throws SQLException if the result set is closed */ public boolean isFirst() throws SQLException { try { debugCodeCall("isFirst"); checkClosed(); int row = result.getRowId(); return row == 0 && row < result.getRowCount(); } catch (Throwable e) { throw logAndConvert(e); } }
/** * Checks if the current position is the last row, that means next() was * called and did not yet returned false, but will in the next call. * * @return if the current position is the last row * @throws SQLException if the result set is closed */ @Override public boolean isLast() throws SQLException { try { debugCodeCall("isLast"); checkClosed(); int row = result.getRowId(); return row >= 0 && row == result.getRowCount() - 1; } catch (Exception e) { throw logAndConvert(e); } }
/** * Checks if the current position is after the last row, that means next() * was called and returned false, and there was at least one row. * * @return if there are results and the current position is after the last * row * @throws SQLException if the result set is closed */ @Override public boolean isAfterLast() throws SQLException { try { debugCodeCall("isAfterLast"); checkClosed(); int row = result.getRowId(); int count = result.getRowCount(); return count > 0 && row >= count; } catch (Exception e) { throw logAndConvert(e); } }
/** * Gets the current row number. The first row is row 1, the second 2 and so * on. This method returns 0 before the first and after the last row. * * @return the row number */ @Override public int getRow() throws SQLException { try { debugCodeCall("getRow"); checkClosed(); int rowId = result.getRowId(); if (rowId >= result.getRowCount()) { return 0; } return rowId + 1; } catch (Exception e) { throw logAndConvert(e); } }
/** * Gets the current row number. The first row is row 1, the second 2 and so * on. This method returns 0 before the first and after the last row. * * @return the row number */ public int getRow() throws SQLException { try { debugCodeCall("getRow"); checkClosed(); int rowId = result.getRowId(); if (rowId >= result.getRowCount()) { return 0; } else { return rowId + 1; } } catch (Throwable e) { throw logAndConvert(e); } }
/** * Checks if the current position is before the first row, that means next() * was not called yet, and there is at least one row. * * @return if there are results and the current position is before the first * row * @throws SQLException if the result set is closed */ @Override public boolean isBeforeFirst() throws SQLException { try { debugCodeCall("isBeforeFirst"); checkClosed(); int row = result.getRowId(); int count = result.getRowCount(); return count > 0 && row < 0; } catch (Exception e) { throw logAndConvert(e); } }
@Override public ResultInterface query(int maxrows) { recompileIfRequired(); setProgress(DatabaseEventListener.STATE_STATEMENT_START); start(); prepared.checkParameters(); ResultInterface result = prepared.query(maxrows); prepared.trace(startTimeNanos, result.getRowCount()); setProgress(DatabaseEventListener.STATE_STATEMENT_END); return result; }
@Override public ResultInterface query(int maxrows) { recompileIfRequired(); setProgress(DatabaseEventListener.STATE_STATEMENT_START); start(); prepared.checkParameters(); ResultInterface result = prepared.query(maxrows); prepared.trace(startTime, result.getRowCount()); setProgress(DatabaseEventListener.STATE_STATEMENT_END); return result; }