IBM DB2 Manual page 55

Table of Contents

Advertisement

Table 6. Valid combinations of resultSetType and resultSetConcurrency for scrollable
ResultSets
resultSetType value
TYPE_FORWARD_ONLY
TYPE_FORWARD_ONLY
TYPE_SCROLL_INSENSITIVE
1
TYPE_SCROLL_SENSITIVE
1
TYPE_SCROLL_SENSITIVE
Note:
1. This value does not apply to connections to IBM Informix Dynamic Server.
resultSetHoldability has two possible values: HOLD_CURSORS_OVER_COMMIT and
CLOSE_CURSORS_AT_COMMIT. Either of these values can be specified with any
valid combination of resultSetConcurrency and resultSetHoldability. The value that
you set overrides the default holdability for the connection.
2. If the SELECT statement has input parameters, invoke setXXX methods to pass
values to the input parameters.
3. Invoke the executeQuery method to obtain the result table from the SELECT
statement in a ResultSet object.
4. For each row that you want to access:
a. Position the cursor using one of the methods that are listed in the following
table.
Table 7. ResultSet methods for positioning a scrollable cursor
Method
1
first
1
last
2
next
1,3
previous
1,4
absolute(int n)
1,5,6,
relative(int n)
1
afterLast
1
beforeFirst
resultSetConcurrency value
CONCUR_READ_ONLY
CONCUR_UPDATABLE
CONCUR_READ_ONLY
CONCUR_READ_ONLY
CONCUR_UPDATABLE
Positions the cursor
On the first row of the ResultSet
On the last row of the ResultSet
On the next row of the ResultSet
On the previous row of the ResultSet
If n>0, on row n of the ResultSet. If n<0, and m is the
number of rows in the ResultSet, on row m+n+1 of
the ResultSet.
If n>0, on the row that is n rows after the current row.
If n<0, on the row that is n rows before the current
row. If n=0, on the current row.
After the last row in the ResultSet
Before the first row in the ResultSet
Chapter 3. JDBC application programming
39

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents