Scalable Database Server, HiRDB Version 8 UAP Development Guide
The JDBC2.0 basic standard has added scroll and parallel processing as the extended features of result sets (ResultSet class).
There are three different scroll types for result sets:
This is the standard scroll type from JDBC1.0. It allows a result set to be scrolled in the forward direction only (from top to bottom).
This is a new scroll type added with JDBC2.0. It allows a result set to be scrolled in a forward or backward direction. It also allows a movement specifying a location relative to the current location or a movement to an absolute location.
Scroll-insensitive means that a change made while a result set is open does not take effect on the result set. In other words, the scroll-insensitive type provides a static view of base data. The rows contained in a result set, their order, and column values are all fixed when the result set is created.
This is a new scroll type added with JDBC2.0. While a result set is open, any change made takes effect on the result set.
Changes that take effect may be made directly to the current result set, or made by another result set within the same transaction, or made by another transaction. The number of changes applied depends on the driver's implementation level and DBMS transaction cut-off level.
There are two different parallel processing types for result sets:
This is the standard parallel processing type from JDBC1.0. It does not allow data to be updated from its result set.
This is a new parallel processing type added with JDBC2.0. It allows data to be updated (UPDATE, INSERT, and DELETE) from its result set.
When the scroll type and parallel processing type are combined, there are six result set types. Specify the result set type to acquire an instance of the Statement class (or its subclass) using the createStatement method, prepareStatement method, or prepareCall method of the Connection class.
Table 16-5 shows the availability of the result set type when you use the JDBC driver.
Table 16-5 Availability of result set types with JDBC driver
Result set type | Availability with JDBC driver | |
---|---|---|
Scroll type | Parallel processing type | |
Forward-only | Read-only | A |
Updatable | NA | |
Scroll-insensitive | Read-only | A |
Updatable | NA | |
Scroll-sensitive | Read-only | NA |
Updatable | NA |
A scroll-type result set caches all retrieval data in the JDBC driver. If there is a large amount of data, a memory shortage or performance reduction may occur. Therefore, to use a scroll-type result set, you must suppress the retrieval data volume in advance by adding a condition to an SQL statement, for example.
All Rights Reserved. Copyright (C) 2007, Hitachi, Ltd.