Scalable Database Server, HiRDB Version 8 UAP Development Guide
The ResultSet interface provides the following principal functions:
Table 17-14 lists the methods of the ResultSet interface. The interface does not support methods that are not listed in the table. If an unsupported method is specified, the interface throws an SQLException.
Table 17-14 ResultSet interface methods
Method | Remarks |
---|---|
absolute(int row) | -- |
afterLast() | -- |
beforeFirst() | -- |
clearWarnings() | -- |
close() | If an error caused by physical disconnection from the database occurs during close method execution when a connection pool or an XA connection is being used and use of the connection pool becomes disabled, a connectionErrorOccurred method of the ConnectionEventListener class does not occur. |
findColumn(String columnName) | -- |
first() | -- |
getAsciiStream(int columnIndex) | -- |
getAsciiStream(String columnName) | -- |
getBigDecimal(int columnIndex) | -- |
getBigDecimal(String columnName) | -- |
getBinaryStream(int columnIndex) | -- |
getBinaryStream(String columnName) | -- |
getBlob(int i) | -- |
getBlob(String colName) | -- |
getBoolean(int columnIndex) | If the data type of the projection column specified by the columnIndex index is HiRDB's MVARCHAR, MCHAR, NVARCHAR, VARCHAR, or CHAR type, one of the following values is returned (after leading and trailing single-byte space characters have been deleted), depending on the data obtained from the HiRDB server:
If the data type of the projection column specified by the columnIndex argument is HiRDB's NCHAR type, one of the following values is retuned (after leading and trailing single-byte space characters have been deleted), depending on the data obtained from the HiRDB server:
|
getBoolean(String columnName) | |
getByte(int columnIndex) | -- |
getByte(String columnName) | -- |
getBytes(int columnIndex) | -- |
getBytes(String columnName) | -- |
getCharacterStream(int columnIndex) | -- |
getCharacterStream(String columnName) | -- |
getConcurrency() | -- |
getCursorName() | Returns the null value. |
getDate(int columnIndex) | -- |
getDate(int columnIndex,Calendar cal) | -- |
getDate(String columnName) | -- |
getDate(String columnName,Calendar cal) | -- |
getDouble(int columnIndex) | -- |
getDouble(String columnName) | -- |
getFetchDirection() | -- |
getFetchSize() | Returns the value that was set for setFetchSize. If no value was set for setFetchSize, this method returns 0. |
getFloat(int columnIndex) | -- |
getFloat(String columnName) | -- |
getInt(int columnIndex) | -- |
getInt(String columnName) | -- |
getLong(int columnIndex) | -- |
getLong(String columnName) | -- |
getMetaData() | -- |
getObject(int columnIndex) | -- |
getObject(String columnName) | -- |
getRow() | If the maximum number of retrieved rows exceeds 2,147,483,647, this method returns 2,147,483,647. |
getShort(int columnIndex) | -- |
getShort(String columnName) | -- |
getStatement() | -- |
getString(int columnIndex) | -- |
getString(String columnName) | -- |
getTime(int columnIndex) | -- |
getTime(int columnIndex,Calendar cal) | -- |
getTime(String columnName) | -- |
getTime(String columnName,Calendar cal) | -- |
getTimestamp(int columnIndex) | -- |
getTimestamp(int columnIndex, Calendar cal) | -- |
getTimestamp(String columnName) | -- |
getTimestamp(String columnName, Calendar cal) | -- |
getType() | -- |
getWarnings() | -- |
isAfterLast() | -- |
isBeforeFirst() | -- |
isFirst() | -- |
isLast() | -- |
last() | -- |
next() | The cursor opens the first time the next method is called. |
previous() | -- |
relative(int rows) | -- |
setFetchDirection(int direction) | -- |
setFetchSize(int rows) | If no value was specified with this method, the JDBC driver uses the number of rows specified for the Statement object as an indicator when it retrieves data. If no number of rows value was specified in the Statement object or if no ResultSet object was generated from the Statement object, the JDBC driver uses the value of the PDBLKF client environment variable as an indicator when it retrieves data. If 0 is specified for this method, the JDBC driver uses the value of the PDBLKF client environment variable as an indicator when it retrieves data. For notes about this method, see 17.4.3(4)(a) Using the block transfer facility by specifying the setFetchSize method. |
wasNull() | Returns false before a value is returned by a getXXX method. |
The names of the package and class for installing this interface are as follows:
Table 17-15 lists the fields supported by the ResultSet interface.
Table 17-15 Fields supported by the ResultSet interface
Field | Remarks |
---|---|
public static final int FETCH_FORWARD | -- |
public static final int FETCH_REVERSE | -- |
public static final int FETCH_UNKNOWN | -- |
public static final int TYPE_FORWARD_ONLY | -- |
public static final int TYPE_SCROLL_INSENSITIVE | -- |
public static final int TYPE_SCROLL_SENSITIVE | When this value is specified, the JDBC driver assumes that TYPE_SCROLL_INSENSITIVE was specified. |
public static final int CONCUR_READ_ONLY | -- |
public static final int CONCUR_UPDATABLE | When this value is specified, the JDBC driver assumes that CONCUR_READ_ONLY was specified. |
public static final int HOLD_CURSORS_OVER_COMMIT | -- |
public static final int CLOSE_CURSORS_AT_COMMIT | -- |
For details about whether mapping is possible with a getXXX method to be used in getting retrieval data, see 17.8.2 Mapping during retrieval data acquisition. If a getXXX method is called for a JDBC SQL type that cannot be mapped, the JDBC driver throws an SQLException.
For details, see 17.4.3(4)(a) Using the block transfer facility by specifying the setFetchSize method.
When the result set type is ResultSet.TYPE_SCROLL_INSENSITIVE or ResultSet.TYPE_SCROLL_SENSITIVE, the JDBC driver allocates memory for accumulating the retrieval results when the following methods of the ResultSet interface are executed:
The JDBC driver assigns and accumulates memory objects to all values in the retrieval results. If a value has a variable length, the memory object is set to the actual size of the retrieved data.
When the next method is executed, the JDBC driver retrieves and accumulates data from the database as described in Table 17-16.
Table 17-16 Data retrieved and accumulated from the database during execution of the next method
Condition | Result set type | |
---|---|---|
TYPE_FORWARD_ONLY | TYPE_SCROLL_INSENSITIVE or TYPE_SCROLL_SENSITIVE | |
The data of the current row, which was moved by the next method, has not been read into the JDBC driver. | The JDBC driver gets the moved current row from the connected database. | The JDBC driver gets the moved current row from the connected database, then reads and stores the row in its memory. |
The data of 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 Table 17-17.
Table 17-17 Data retrieved and accumulated from the database during execution of the absolute, relative, last, or afterLast method
Condition | Result set type is TYPE_SCROLL_INSENSITIVE or TYPE_SCROLL_SENSITIVE |
---|---|
The first row to the specified row# of the retrieval results contain data that the JDBC driver has not read. | The JDBC driver retrieves the rows that were not read from the connected database and stores them in its memory. |
The first row to the specified row# of the retrieval results do not contain data that the JDBC driver has not read. | The JDBC driver does not retrieve data from the connected database. |
The JDBC driver does not implicitly close objects returned by the getAsciiStream, getBinaryStream, getCharacterStream, and getUnicodeStream methods. You must make provision for the method-calling side to execute the close method.
Table 17-18 shows the number of retrieved rows that ResultSet objects can obtain from the HiRDB server. The JDBC driver discards retrieval results that exceed the applicable number of rows shown in Table 17-18.
Table 17-18 Number of retrieved rows that ResultSet objects can obtain from the HiRDB server
ResultSet object | Result set type | |
---|---|---|
TYPE_SCROLL_INSENSITIVE or TYPE_SCROLL_SENSITIVE | Other type | |
ResultSet object generated by Statement object that executed setMaxRows method | The number of retrieved rows is the number of rows specified by setMaxRows method. | |
Other ResultSet object | The number of retrieved rows is the upper limit for setMaxRows (2,147,483,647). | No upper limit |
All Rights Reserved. Copyright (C) 2007, Hitachi, Ltd.