IBM DB2 Manual page 54

Table of Contents

Advertisement

If a JDBC ResultSet is static, the size of the result table and the order of the rows
in the result table do not change after the cursor is opened. This means that if you
insert rows into the underlying table, the result table for a static ResultSet does
not change. If you delete a row of a result table, a delete hole occurs. You cannot
update or delete a delete hole.
Specifying updatability, scrollability, and holdability for ResultSets in JDBC
applications:
You use special parameters in the Connection.prepareStatement or
Connection.createStatement methods to specify the updatability, scrollability, and
holdability of a ResultSet.
By default, ResultSet objects not scrollable and not updatable. The default
holdability depends on the data source, and can be determined from the
DatabaseMetaData.getResultSetHoldability method. To change the scrollability,
updatability, and holdability attributes for a ResultSet, follow these steps:
1. If the SELECT statement that defines the ResultSet has no input parameters,
38
Application Programming Guide and Reference for Java
Related concepts
"Temporary table space storage requirements" (DB2 Installation Guide)
Related tasks
"Specifying updatability, scrollability, and holdability for ResultSets in JDBC
applications"
Related reference
"Driver support for JDBC APIs" on page 252
invoke the createStatement method to create a Statement object. Otherwise,
invoke the prepareStatement method to create a PreparedStatement object. You
need to specify forms of the createStatement or prepareStatement methods
that include the resultSetType, resultSetConcurrency, or resultSetHoldability
parameters.
The form of the createStatement method that supports scrollability and
updatability is:
createStatement(int resultSetType, int resultSetConcurrency);
The form of the createStatement method that supports scrollability,
updatability, and holdability is:
createStatement(int resultSetType, int resultSetConcurrency,
int resultSetHoldability);
The form of the prepareStatement method that supports scrollability and
updatability is:
prepareStatement(String sql, int resultSetType,
int resultSetConcurrency);
The form of the prepareStatement method that supports scrollability,
updatability, and holdability is:
prepareStatement(String sql, int resultSetType,
int resultSetConcurrency, int resultSetHoldability);
The following table contains a list of valid values for resultSetType and
resultSetConcurrency.

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents