@Override public boolean last() throws SQLException { return rs.last(); }
@Override public boolean last() throws SQLException { return delegate.last(); }
/** * @see java.sql.ResultSet#last() */ @Override public boolean last() throws InvalidResultSetAccessException { try { return this.resultSet.last(); } catch (SQLException se) { throw new InvalidResultSetAccessException(se); } }
@Override public boolean last() throws SQLException { try { return rs.last(); } catch (Throwable t) { throw checkException(t); } }
ResultSet rs = ps.executeQuery(); int rowcount = 0; if (rs.last()) { rowcount = rs.getRow(); rs.beforeFirst(); // not rs.first() because the rs.next() below will move on, missing the first element } while (rs.next()) { // do your standard per row stuff }
@Override public void run() throws Exception { rs.last(); } });
private int getRowCount(ResultSet resultSet) { if (resultSet == null) { return 0; } try { resultSet.last(); return resultSet.getRow(); } catch (SQLException exp) { exp.printStackTrace(); } finally { try { resultSet.beforeFirst(); } catch (SQLException exp) { exp.printStackTrace(); } } return 0; }
/** * Try to obtain the current size of the specified {@link ResultSet} by jumping to the last row * and getting the row number. * * @param rs * the {@link ResultSet} to get the size for * @return the size, or -1 if it could not be obtained */ int getSize(ResultSet rs) { try { if (rs.getType() == rs.TYPE_FORWARD_ONLY) { return -1; } rs.last(); int total = rs.getRow(); rs.beforeFirst(); return total; } catch (SQLException sqle) { return -1; } // JDBC 1 driver error catch (AbstractMethodError ame) { return -1; } }
@Override public boolean resultSet_last(ResultSetProxy rs) throws SQLException { if (this.pos < filterSize) { return nextFilter() .resultSet_last(this, rs); } return rs.getResultSetRaw() .last(); }
@Override public boolean last() { try { final boolean result = getResultSet().last(); prepareCurrentRow( result ); return result; } catch (SQLException sqle) { throw convert( sqle, "could not advance using last()" ); } }
@Override public boolean last() throws SQLException { return delegate.last(); }
@Override public boolean last() throws SQLException { return innerResultSet.last(); }
@Override public boolean last() throws SQLException { return innerResultSet.last(); }
@Override public boolean last() throws SQLException { return rs.last(); }
public boolean last() throws SQLException { return _rs.last(); }
else if (rs.last()) {
ResultSet rs = stmt.executeQuery(sql); int rowCount = rs.last() ? rs.getRow() : 0; // Number of rows in result set. Don't forget to set cyrsor to beforeFirst() row! :)
@Override public boolean last() throws SQLException { try { return rs.last(); } catch (Throwable t) { throw checkException(t); } }
resultSet.last(); keyToRead = getKeyFromResultSet( 0,
@Override public boolean resultSet_last(ResultSetProxy rs) throws SQLException { if (this.pos < filterSize) { return nextFilter() .resultSet_last(this, rs); } return rs.getResultSetRaw() .last(); }