Hitachi

Hitachi Advanced Database Application Development Guide


8.5.74 Notes about the ResultSet interface

Organization of this subsection

(1) Value acquisition using a getXXX method

(2) Data mapping (conversion)

For details about whether mapping is possible with a getXXX method that is to be used for retrieval data acquisition, see (2) Mapping during retrieval data acquisition in 7.6.1 Mapping data types. If a getXXX method is called for a JDBC SQL data type that cannot be mapped, the JDBC driver throws an SQLException.

(3) Memory size used when the result set type is ResultSet.TYPE_SCROLL_INSENSITIVE or ResultSet.TYPE_SCROLL_SENSITIVE

If the result set type is ResultSet.TYPE_SCROLL_INSENSITIVE or ResultSet.TYPE_SCROLL_SENSITIVE when the following methods in the ResultSet interface are executed, the JDBC driver allocates memory for accumulating the retrieval results:

The JDBC driver assigns and accumulates memory objects to all values in the retrieval results. If a value is variable length, the memory object is set to the actual size of the retrieved data.

(4) next, absolute, relative, last, and afterLast methods

When the next method is executed, the JDBC driver retrieves and accumulates data from the database as described in the following table.

Table 8‒38: Data retrieved and accumulated from the database during execution of the next method

Condition

Result set type

ResultSet.TYPE_FORWARD_ONLY

ResultSet.TYPE_SCROLL_INSENSITIVE

or ResultSet.TYPE_SCROLL_SENSITIVE

The data on the current row, which was moved by the next method, has not been read into the JDBC driver.

The JDBC driver acquires the moved current row from the connected database.

The JDBC driver acquires the moved current row from the connected database, then reads and accumulates the row in its memory.

The data on the current row, which was moved by the next method, has been read into the JDBC driver.

The JDBC driver does not retrieve data from the connected database.

When the absolute, relative, last, or afterLast method is executed, the JDBC driver retrieves and accumulates data from the database as described in the following table.

Table 8‒39: Data retrieved and accumulated from the database during execution of the absolute, relative, last, or afterLast method

Condition

Result set type is

ResultSet.TYPE_SCROLL_INSENSITIVE

or ResultSet.TYPE_SCROLL_SENSITIVE

Between the first row and the specified row# of the retrieval results there is data that the JDBC driver has not read.

The JDBC driver retrieves the rows that were not read from the database and accumulates them in its memory.

The JDBC driver has read all the data contained on the first row through the specified row# of the retrieval results.

The JDBC driver does not retrieve data from the database.

Note

If the result set type is ResultSet.TYPE_FORWARD_ONLY, the JDBC driver throws an SQLException.

#

If the last or afterLast method is used, the range is from the first row to the last row.

(5) Notes about the getAsciiStream and getCharacterStream methods

The JDBC driver does not implicitly close objects returned by the getAsciiStream and getCharacterStream methods. The program that called these methods must execute the close method.

(6) Maximum number of retrieved rows

The following table shows the number of rows that a ResultSet object can retrieve from the HADB server. The JDBC driver discards retrieval results in excess of the applicable number of rows shown in the following table.

Table 8‒40: Number of rows that a ResultSet object can retrieve from the HADB server

ResultSet object

Result set type

ResultSet.TYPE_SCROLL_INSENSITIVE or ResultSet.TYPE_SCROLL_SENSITIVE

Other type

ResultSet object created from a Statement object that executed one of the following methods:

  • setMaxRows

  • setLargeMaxRows

The number of retrieved rows is the number of rows specified by the following methods:

  • setMaxRows

  • setLargeMaxRows

If a value is specified in the setLargeMaxRows method that exceeds Integer.MAX_VALUE, the maximum value will be Integer.MAX_VALUE.

The number of retrieved rows is the number of rows specified in the following methods:

  • setMaxRows

  • setLargeMaxRows

Other ResultSet object

The maximum value is Integer.MAX_VALUE.

There is no limit.