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
498234
int getSize(ResultSet rs) {
    try {
      if (rs.getType() == ResultSet.TYPE_FORWARD_ONLY) {
        return -1;
      }

      rs.last();
      int total = rs.getRow();
      rs.beforeFirst();
      return total;
    } catch (SQLException | AbstractMethodError sqle) {
      return -1;
    }
  }
1129932
public int getSize(Row row) {

        Object[] data  = row.getData();
        Type[]   types = row.getTable().getColumnTypes();
        int      cols  = row.getTable().getDataColumnCount();

        return INT_STORE_SIZE + getSize(data, cols, types);
    }
354555
public RowResultSet<R> resultSet(int maxRows) {
        if (maxRows <= 0) {
            return new RowResultSet<R>(getRows());
        } // end of if

        return new RowResultSet<R>(getRows().subList(0, maxRows));
    }
1023980
public int getRow() {
        if(_currentRow != null) {
            int row = _currentRow.intValue();

            /* if the row is out of range, simply adjust to the last row */
            if(_dataSetSize != null && (row > _dataSetSize.intValue()))
                row = _dataSetSize.intValue();

            if(row % getPageSize() != 0) {
                int adjustedPage = row - (row % getPageSize());
                return adjustedPage;
            }
            else return row;
        }
        else return DEFAULT_ROW;
    }
1086255
public static String getOjbClassName(ResultSet rs)
    {
        try
        {
            return rs.getString(OJB_CLASS_COLUMN);
        }
        catch (SQLException e)
        {
            return null;
        }
    }
493459
@Override
  public RowSet getNextRowSet(FetchOrientation orientation, long maxRows) throws HiveSQLException {
    assertState(OperationState.FINISHED);
    validateDefaultFetchOrientation(orientation);
    if (orientation.equals(FetchOrientation.FETCH_FIRST)) {
      rowSet.setStartOffset(0);
    }
    return rowSet.extractSubset((int)maxRows);
  }
1032852
private void closeResultSet(ResultSet rs) {
    if (rs != null) {
      try {
        rs.close();
      } catch (SQLException e) {
        logger.error("Could not close JDBC ResultSet", e);
      } catch (Throwable e) {
        logger.error("Unexpected exception on closing JDBC ResultSet", e);
      }
    }
  }
162940
public static List<Integer> getIntegerList(final ResultSet rs, final String columnName) throws SQLException
    {
        final Array ary = rs.getArray(columnName);
        if (ary != null) {
            Preconditions.checkArgument(ary.getBaseType() == Types.INTEGER || ary.getBaseType() == Types.SMALLINT);
            return Arrays.asList((Integer []) ary.getArray());
        }
        return null;
    }
767572
public int getViewSize() {
        if(viewSize > 0) {
            return viewSize;
        }
        if(direction == Direction.HORIZONTAL) {
            return getSize().getColumns();
        }
        else {
            return getSize().getRows();
        }
    }
63259
private int getSeriesSize(String series) {
        synchronized (dataStoreLock) {
            if (dataStore == null) {
                return 0;
            }
            if (seriesToBatch.containsKey(series)) {
                return (int) seriesToBatch.get(series).getDataSize();
            } else {
                return 0;
            }
        }
    }
932595
@SuppressFBWarnings("NP_BOOLEAN_RETURN_NULL")
    public static Boolean getBoolean(final ResultSet rs, final String columnName) throws SQLException
    {
        final boolean res = rs.getBoolean(columnName);
        if (rs.wasNull()) {
            return null;
        }
        else {
            return res;
        }
    }
1115449
public Integer getColWidth() {
        final Object result = getStateHelper().eval(PropertyKeys.colWidth, null);
        if (result == null) {
            return null;
        }
        return Integer.valueOf(result.toString());
    }
1239815
public static int getRowCount(Connection connection, String tableReference) throws SQLException {
        Statement st = connection.createStatement();
        int rowCount = 0;
        try {
            ResultSet rs = st.executeQuery(String.format("select count(*) rowcount from %s", TableLocation.parse(tableReference)));
            try {
                if(rs.next()) {
                    rowCount = rs.getInt(1);
                }
            } finally {
                rs.close();
            }
        }finally {
            st.close();
        }
        return rowCount;
    }
93638
public int getRowWidth() {

        int overallWidth = 0;
        for (int i = 0; i < data.length; i++) {
            overallWidth += getTable().getColumnWidth(i);
        }
        return overallWidth;
    }
1180602
protected T getRowObject(int rowIndex) {
		int pageIndex = rowIndex - dataOffset;
		if (pageIndex >= 0 && pageIndex < data.size()) {
			return data.get(pageIndex);
		}
		return null;
	}
404363
static Cl map(ResultSet rs, int colShift)
    {
        Cl tmp = new Cl();

        try
        {
            tmp.id = rs.getInt(1 + colShift);
            tmp.name = rs.getString(2 + colShift);
            tmp.childFirst = rs.getBoolean(3 + colShift);
            tmp.hiddenClasses = rs.getString(4 + colShift);
            tmp.tracingEnabled = rs.getBoolean(5 + colShift);
            tmp.persistent = rs.getBoolean(6 + colShift);
            tmp.allowedRunners = rs.getString(7 + colShift);
        }
        catch (SQLException e)
        {
            throw new DatabaseException(e);
        }
        return tmp;
    }
196121
private IEntityLock instanceFromResultSet(java.sql.ResultSet rs)
            throws SQLException, LockingException {
        Integer entityTypeID = rs.getInt(1);
        Class entityType = EntityTypesLocator.getEntityTypes().getEntityTypeFromID(entityTypeID);
        String key = rs.getString(2);
        int lockType = rs.getInt(3);
        Timestamp ts = rs.getTimestamp(4);
        String lockOwner = rs.getString(5);

        return newInstance(entityType, key, lockType, ts, lockOwner);
    }