8.5.74 Notes about the ResultSet interface
- Organization of this subsection
(1) Value acquisition using a getXXX method
-
For details about whether mapping is possible with a getXXX method, see (2) Mapping during retrieval data acquisition in 7.6.1 Mapping data types.
-
If a nonexistent column number or column name is specified in a getXXX method, the JDBC driver throws an SQLException.
-
If a value specified in a getXXX method cannot represent the actual value (for example, if getShort is used to acquire the INTEGER-type value 40,000), overflow occurs and an SQLException results. For the combinations of a getXXX method and HADB data type that can cause overflow to occur, see 7.6.3 Overflow handling.
(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:
-
ResultSet.next method
-
ResultSet.last method
-
ResultSet.absolute method
-
ResultSet.relative method
-
ResultSet.afterLast method
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.
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.
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.
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:
|
The number of retrieved rows is the number of rows specified by the following methods:
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:
|
Other ResultSet object |
The maximum value is Integer.MAX_VALUE. |
There is no limit. |