Logo Search packages:      
Sourcecode: mysql-connector-java version File versions

boolean com::mysql::jdbc::ResultSet::relative ( int  rows  )  throws SQLException [inline]

JDBC 2.0

Moves a relative number of rows, either positive or negative. Attempting to move beyond the first/last row in the result set positions the cursor before/after the the first/last row. Calling relative(0) is valid, but does not change the cursor position.

Note: Calling relative(1) is different than calling next() since is makes sense to call next() when there is no current row, for example, when the cursor is positioned before the first row or after the last row of the result set.

Parameters:
rows the number of relative rows to move the cursor.
Returns:
true if on a row, false otherwise.
Exceptions:
SQLException if a database-access error occurs, or there is no current row, or result set type is TYPE_FORWARD_ONLY.

Reimplemented in com::mysql::jdbc::UpdatableResultSet.

Definition at line 3016 of file ResultSet.java.

                                                          {
        checkClosed();

        if (this.rowData.size() == 0) {
            return false;
        }

        this.rowData.moveRowRelative(rows);
        this.thisRow = this.rowData.getAt(this.rowData.getCurrentRowNumber());

        return (!this.rowData.isAfterLast() && !this.rowData.isBeforeFirst());
    }


Generated by  Doxygen 1.6.0   Back to index