public boolean next() throws SQLException {
        /*
         * make sure things look sane. The cursor must be
         * positioned in the rowset or before first (0) or
         * after last (numRows + 1)
         */
        if (cursorPos < 0 || cursorPos >= numRows + 1) {
            throw new SQLException(resBundle.handleGetObject("cachedrowsetimpl.invalidcp").toString());
        }
        // now move and notify
        boolean ret = this.internalNext();
        notifyCursorMoved();

        return ret;
    }
Moves the cursor down one row from its current position and
returns <code>true</code> if the new cursor position is a
valid row.
The cursor for a new <code>ResultSet</code> object is initially
positioned before the first row. The first call to the method
<code>next</code> moves the cursor to the first row, making it
the current row; the second call makes the second row the
current row, and so on.

<P>If an input stream from the previous row is open, it is
implicitly closed. The <code>ResultSet</code> object's warning
chain is cleared when a new row is read.

@return <code>true</code> if the new current row is valid;
        <code>false</code> if there are no more rows
@throws SQLException if an error occurs or
           the cursor is not positioned in the rowset, before
           the first row, or after the last row
src/main/java/org/replicadb/rowset/sun/rowset/CachedRowSetImpl.java