The IBM® Data Server Driver for JDBC and SQLJ provides support for scrollable, updatable, and holdable cursors.
If a cursor for a ResultSet is scrollable, it also has a sensitivity attribute, which describes whether the cursor is sensitive to changes to the underlying table.
You set the updatability, scrollability, and holdability characteristics of a ResultSet through parameters in the Connection.prepareStatement or Connection.createStatement methods. The ResultSet settings map to attributes of a cursor in the database. The following table lists the JDBC scrollability, updatability, and holdability settings, and the corresponding cursor attributes.
JDBC setting | DB2® cursor setting | IBM Informix® cursor setting |
---|---|---|
CONCUR_READ_ONLY | FOR READ ONLY | FOR READ ONLY |
CONCUR_UPDATABLE | FOR UPDATE | FOR UPDATE |
HOLD_CURSORS_OVER_COMMIT | WITH HOLD | WITH HOLD |
TYPE_FORWARD_ONLY | SCROLL not specified | SCROLL not specified |
TYPE_SCROLL_INSENSITIVE | INSENSITIVE SCROLL | SCROLL |
TYPE_SCROLL_SENSITIVE | SENSITIVE STATIC, SENSITIVE DYNAMIC, or ASENSITIVE, depending on the cursorSensitivity Connection and DataSource property | Not supported |
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.