Hitachi

Hitachi Advanced Database Application Development Guide


8.5.2 absolute(int row)

Organization of this subsection

(1) Function

This method moves the cursor to a specified row in the ResultSet object.

(2) Format

public synchronized boolean absolute(int row) throws SQLException

(3) Arguments

int row

Specifies the number of the row to which the cursor is to be moved. A positive number indicates that the row numbers in the result set are to be counted from the beginning, and a negative number indicates that the row numbers are to be counted from the end of the result set.

(4) Return value

If the cursor position resulting from the absolute method call is before the first row or after the last row, the method returns false; otherwise, the method returns true.

The following table shows the destination of the cursor and the return value when the absolute method is executed.

Table 8‒15: Location to which the cursor is moved and return value when the absolute method is executed

Number of rows in result set#

Specified row value

Destination of cursor

Return value

0

Non-zero value

Remains before the first row

false

n

n < row

After the last row

false

1 ≤ rown

row

true

-nrow ≤ -1

(n + 1) + row

true

row < -n

Before the first row

false

#

If the actual number of rows is greater than the setMaxRows value, the setMaxRows value takes effect.

If the actual number of rows is greater than the setLargeMaxRows value, the setLargeMaxRows value takes effect.

(5) Exceptions

The JDBC driver throws an SQLException in the following cases: