Nonstop Database, HiRDB Version 9 UAP Development Guide
The ResultSet interface provides the following principal functions:
The table below 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 18-27 ResultSet interface methods
Subsection | Method | Function |
---|---|---|
(a) | absolute(int row) | Moves the cursor to a specified row in this ResultSet object. |
(b) | afterLast() | Moves the cursor to the location immediately following the last row in this ResultSet object. |
(c) | beforeFirst() | Moves the cursor to the location immediately preceding the first row in this ResultSet object. |
(d) | clearWarnings() | Clears all warnings reported about this ResultSet object. |
(e) | close() | Closes the database cursor that has been opened for this ResultSet object and releases JDBC resources. |
(f) | findColumn(String columnName) | Maps a specified column name to its column number. |
(g) | first() | Moves the cursor to the first row in this ResultSet object. |
(h) | getArray(int i) | Acquires as an Array object the elements of the repetition column with a specified column number located in the current row of this ResultSet object. |
(i) | getArray(String colName) | Acquires as an Array object the elements of the repetition column with a specified column name located in the current row of the ResultSet object. |
(j) | getAsciiStream(int columnIndex) | Acquires as a PrdbDataStream object the value of a specified column in the current row of this ResultSet object. |
(k) | getAsciiStream(String columnName) | Acquires as a PrdbDataStream object the value of a specified column in the current row of this ResultSet object. |
(l) | getBigDecimal(int columnIndex) | Acquires as a java.math.BigDecimal object the value of a specified column in the current row of this ResultSet object. |
(m) | getBigDecimal(int columnIndex, int scale) | Acquires the value of a specified column in the current row of this ResultSet object as a java.math.BigDecimal object with the number of decimal places specified in scale. |
(n) | getBigDecimal(String columnName) | Acquires as a java.math.BigDecimal object the value of a specified column in the current row of this ResultSet object. |
(o) | getBigDecimal(String columnName, int scale) | Acquires the value of a specified column in the current row of this ResultSet object as a java.math.BigDecimal object with the number of decimal places specified in scale. |
(p) | getBinaryStream(int columnIndex) | Acquires as a binary stream the value of the column with a specified column number located in the current row of this ResultSet object. |
(q) | getBinaryStream(String columnName) | Acquires as a binary stream the value of a specified column in the current row of this ResultSet object. |
(r) | getBlob(int i) | Acquires as a java.sql.Blob object the value of the column with a specified column number located in the current row of this ResultSet object. |
(s) | getBlob(String colName) | Acquires as a java.sql.Blob object the value of a specified column in the current row of this ResultSet object |
(t) | getBoolean(int columnIndex) | Acquires the value of a specified column in the current row of this ResultSet object as boolean in Java programming language. |
(u) | getBoolean(String columnName) | Acquires the value of a specified column in the current row of this ResultSet object as boolean in Java programming language. |
(v) | getByte(int columnIndex) | Acquires the value of a specified column in the current row of this ResultSet object as byte in Java programming language. |
(w) | getByte(String columnName) | Acquires the value of a specified column in the current row of this ResultSet object as byte in Java programming language. |
(x) | getBytes(int columnIndex) | Acquires the value of a specified column in the current row of this ResultSet object as a byte array in Java programming language. |
(y) | getBytes(String columnName) | Acquires the value of a specified column in the current row of this ResultSet object as a byte array in Java programming language. |
(z) | getCharacterStream(int columnIndex) | Acquires as a java.io.Reader object the value of a specified column in the current row of this ResultSet object. |
(aa) | getCharacterStream(String columnName) | Acquires as a java.io.Reader object the value of a specified column in the current row of this ResultSet object. |
(ab) | getConcurrency() | Returns the parallel processing mode of this ResultSet object. |
(ac) | getCursorName() | Acquires the name of the SQL cursor used by this ResultSet object. |
(ad) | getDate(int columnIndex) | Acquires as a java.sql.Date object the value of a specified column in the current row of this ResultSet object. |
(ae) | getDate(int columnIndex,Calendar cal) | Acquires as a java.sql.Date object the value of a specified column in the current row of this ResultSet object. |
(af) | getDate(String columnName) | Acquires as a java.sql.Date object the value of a specified column in the current row of this ResultSet object. |
(ag) | getDate(String columnName,Calendar cal) | Acquires as a java.sql.Date object the value of a specified column in the current row of this ResultSet object. |
(ah) | getDouble(int columnIndex) | Acquires the value of a specified column in the current row of this ResultSet object as double in Java programming language. |
(ai) | getDouble(String columnName) | Acquires the value of a specified column in the current row of this ResultSet object as double in Java programming language. |
(aj) | getFetchDirection() | Acquires the fetch direction of this ResultSet object. |
(ak) | getFetchSize() | Acquires the fetch size of this ResultSet object. |
(al) | getFloat(int columnIndex) | Acquires the value of a specified column in the current row of this ResultSet object as float in Java programming language. |
(am) | getFloat(String columnName) | Acquires the value of a specified column in the current row of this ResultSet object as float in Java programming language. |
(an) | getInt(int columnIndex) | Acquires the value of a specified column in the current row of this ResultSet object as int in Java programming language. |
(ao) | getInt(String columnName) | Acquires the value of a specified column in the current row of this ResultSet object as int in Java programming language. |
(ap) | getLong(int columnIndex) | Acquires the value of a specified column in the current row of this ResultSet object as long in Java programming language. |
(aq) | getLong(String columnName) | Acquires the value of a specified column in the current row of this ResultSet object as long in Java programming language. |
(ar) | getMetaData() | Returns ResultSetMetaData that represents this ResultSet object's meta information. |
(as) | getObject(int columnIndex) | Acquires the value of a specified column in the current row of this ResultSet object as Object in Java programming language. |
(at) | getObject(String columnName) | Acquires the value of a specified column in the current row of this ResultSet object as Object in Java programming language. |
(au) | getRow() | Acquires the current row number. |
(av) | getShort(int columnIndex) | Acquires the value of a specified column in the current row of this ResultSet object as short in Java programming language. |
(aw) | getShort(String columnName) | Acquires the value of a specified column in the current row of this ResultSet object as short in Java programming language. |
(ax) | getStatement() | Acquires the Statement object that created this ResultSet object. |
(ay) | getString(int columnIndex) | Acquires the value of a specified column in the current row of this ResultSet object as String in Java programming language. |
(az) | getString(String columnName) | Acquires the value of a specified column in the current row of this ResultSet object as String in Java programming language. |
(ba) | getTime(int columnIndex) | Acquires as java.sql.Time the value of a specified column in the current row of this ResultSet object. |
(bb) | getTime(int columnIndex,Calendar cal) | Acquires as a java.sql.Time object the value of a specified column in the current row of this ResultSet object. |
(bc) | getTime(String columnName) | Acquires as a java.sql.Time object the value of a specified column in the current row of this ResultSet object. |
(bd) | getTime(String columnName,Calendar cal) | Acquires as a java.sql.Time object the value of a specified column in the current row of this ResultSet object. |
(be) | getTimestamp(int columnIndex) | Acquires as a java.sql.Timestamp object the value of a specified column in the current row of this ResultSet object. |
(bf) | getTimestamp(int columnIndex, Calendar cal) | Acquires as a java.sql.Timestamp object the value of a specified column in the current row of this ResultSet object. |
(bg) | getTimestamp(String columnName) | Acquires as a java.sql.Timestamp object the value of a specified column in the current row of this ResultSet object. |
(bh) | getTimestamp(String columnName, Calendar cal) | Acquires as a java.sql.Timestamp object the value of a specified column in the current row of this ResultSet object. |
(bi) | getType() | Returns the type of this ResultSet object. |
(bj) | getWarnings() | Acquires the first warning reported by a call related to this ResultSet object. |
(bk) | isAfterLast() | Acquires a value indicating whether the cursor is located after the last row in this ResultSet object. |
(bl) | isBeforeFirst() | Acquires a value indicating whether the cursor is located before the first row in this ResultSet object. |
(bm) | isFirst() | Acquires a value indicating whether the cursor is located on the first row in this ResultSet object. |
(bn) | isLast() | Acquires a value indicating whether the cursor is located on the last row in this ResultSet object. |
(bo) | last() | Moves the cursor to the last row of this ResultSet object. |
(bp) | next() | Moves the cursor from the current position to the next row. |
(bq) | previous() | Moves the cursor to the immediately preceding row in this ResultSet object. |
(br) | relative(int rows) | Moves the cursor by the specified number of rows in the forward or reverse direction relative to the current position. |
(bs) | setFetchDirection(int direction) | Sets the default fetch direction for the result set that is created from this Statement object. |
(bt) | setFetchSize(int rows) | Sets the fetch size of this ResultSet object. |
(bu) | wasNull() | Reports whether the last column value acquired is the NULL value. |
public synchronized boolean absolute(int row) throws SQLException
Table 18-28 Destination of absolute and the return value
Number of rows in result set# | Specified row value | Destination | Return value |
---|---|---|---|
0 | Non-zero value | Remains before the first row | false |
n | n < row | After the last row | false |
1 |
row | true | |
-n |
(n + 1) + row | true | |
row < -n | Before the first row | false |
public synchronized void afterLast() throws SQLException
Table 18-29 Destination of afterLast
Number of rows in result set# | Current row | Row after afterLast() is called |
---|---|---|
0 | Before the first row | Remains before the first row |
n | Before the first row | After the last row |
1 |
After the last row | |
After the last row | Remains after the last row |
public synchronized void beforeFirst() throws SQLException
Table 18-30 Destination of beforeFirst
Number of rows in result set# | Current row | Row after beforeFirst() is called |
---|---|---|
0 | Before the first row | Remains before the first row |
n | Before the first row | Remains before the first row |
1 |
Before the first row | |
After the last row | Before the first row |
public synchronized void clearWarnings() throws SQLException
public synchronized void close() throws SQLException
public synchronized int findColumn(String columnName) throws SQLException
public synchronized boolean first() throws SQLException
public Array getArray(int i) throws SQLException
public Array getArray(String colName) throws SQLException
public synchronized InputStream getAsciiStream (int columnIndex) throws SQLException
HiRDB data type | Retrieval result | Return value |
---|---|---|
[M|N][VAR]CHARBINARYBLOB | NULL | null |
Other than the above | InputStream object containing the retrieval result | |
Other | -- | SQLException is thrown |
public synchronized InputStream getAsciiStream (String columnName) throws SQLException
public synchronized BigDecimal getBigDecimal (int columnIndex) throws SQLException
HiRDB data type | Retrieval result | Return value |
---|---|---|
[M|N][VAR]CHAR | NULL | null |
[single-byte-space]integer-in-character-string-representation[single-byte-space], [single-byte-space]decimal-number-in-character-string-representation[single-byte-space], or [single-byte-space]floating-point-number-in-character-string-representation[single-byte-space] | BigDecimal object containing the retrieval results. The value without the single-byte spaces at the beginning and end of the character string is used as the BigDecimal object. |
|
Other than the above | SQLException is thrown | |
SMALLINT | NULL | null |
Other than the above | BigDecimal object containing the retrieval results | |
INTEGER | NULL | null |
Other than the above | BigDecimal object containing the retrieval results | |
REAL | NULL | null |
Infinity | SQLException is thrown | |
-Infinity | SQLException is thrown | |
NaN | SQLException is thrown | |
Other than the above | BigDecimal object containing the retrieval results | |
FLOAT | NULL | null |
Infinity | SQLException is thrown | |
-Infinity | SQLException is thrown | |
NaN | SQLException is thrown | |
Other than the above | BigDecimal object containing the retrieval results | |
DECIMAL | NULL | null |
Other than the above | BigDecimal object containing the retrieval results | |
BOOLEAN# | NULL | null |
true | BigDecimal object obtained based on BigDecimal(1) | |
false | BigDecimal object obtained based on BigDecimal(0) | |
Other | -- | SQLException is thrown |
Legend:
--: Not applicable
#: There is BOOLEAN-type data when the Resultset was created from DatabaseMetadata.
public synchronized BigDecimal getBigDecimal(int columnIndex,int scale) throws SQLException
public synchronized BigDecimal getBigDecimal (String columnName) throws SQLException
public synchronized BigDecimal getBigDecimal(String columnName,int scale) throws SQLException
public synchronized InputStream getBinaryStream(int columnIndex) throws SQLException
HiRDB data type | Retrieval result | Return value |
---|---|---|
BINARYBLOB | NULL | null |
Other than the above | InputStream object containing the retrieval result | |
Other | -- | SQLException is thrown |
public synchronized InputStream getBinaryStream (String columnName) throws SQLException
public synchronized Blob getBlob(int i) throws SQLException
HiRDB data type | Retrieval result | Return value |
---|---|---|
BINARYBLOB | NULL | null |
Other than the above | java.sql.Blob object containing the retrieval results | |
Other | -- | SQLException is thrown |
public synchronized Blob getBlob(String colName) throws SQLException
public synchronized boolean getBoolean(int columnIndex) throws SQLException
HiRDB data type | Retrieval result | Return value |
---|---|---|
[M][VAR]CHARNVARCHAR | NULL | false |
[single-byte-space]true (single-byte characters; not case-sensitive)[single-byte-space] | true | |
[single-byte-space]1 (single-byte character)[single-byte-space] | true | |
Other than the above | false | |
NCHAR | NULL | false |
Value beginning with [single-byte-space]true (single-byte characters; not case-sensitive) | true | |
Other than the above | false | |
SMALLINT | NULL | false |
0 | false | |
Non-zero value | true | |
INTEGER | NULL | false |
0 | false | |
Non-zero value | true | |
REAL | NULL | false |
Infinity | true | |
-Infinity | true | |
NaN | true | |
0.0 or -0.0 | false | |
Other than the above | true | |
FLOAT | NULL | false |
Infinity | true | |
-Infinity | true | |
NaN | true | |
0.0 or -0.0 | false | |
Other than the above | true | |
DECIMAL | NULL | false |
0[.00...0] | false | |
Other than the above | true | |
BOOLEAN# | NULL | false |
Non-NULL | Retrieval result | |
Other | -- | SQLException is thrown |
Legend:
--: Not applicable
#: There is BOOLEAN-type data when the Resultset was created from DatabaseMetadata.
public synchronized boolean getBoolean(String columnName) throws SQLException
public synchronized byte getByte(int columnIndex) throws SQLException
HiRDB data type | Retrieval result | Return value |
---|---|---|
[M|N][VAR]CHAR | NULL | 0 |
[single-byte-space]integer-in-character-string-representation[single-byte-space], [single-byte-space]decimal-number-in-character-string-representation[single-byte-space], or [single-byte-space]floating-point-number-in-character-string-representation[single-byte-space], and Byte.MIN_VALUE or greater, and Byte.MAX_VALUE or less | Retrieval result converted to a byte value | |
[single-byte-space]integer-in-character-string-representation[single-byte-space], [single-byte-space]decimal-number-in-character-string-representation[single-byte-space], or [single-byte-space]floating-point-number-in-character-string-representation[single-byte-space], and greater than Byte.MAX_VALUE or less than Byte.MIN_VALUE | SQLException is thrown | |
[single-byte-space][+]Infinity[single-byte-space] | SQLException is thrown | |
[single-byte-space]-Infinity[single-byte-space] | SQLException is thrown | |
[single-byte-space][+|-]NaN[single-byte-space] | SQLException is thrown | |
Other than the above (double value cannot be obtained) | SQLException is thrown | |
SMALLINT | NULL | 0 |
Byte.MIN_VALUE or greater and Byte.MAX_VALUE or less | Retrieval result converted to a byte value | |
Other than the above | SQLException is thrown | |
INTEGER | NULL | 0 |
Byte.MIN_VALUE or greater and Byte.MAX_VALUE or less | Retrieval result converted to a byte value | |
Other than the above | SQLException is thrown | |
REAL | NULL | 0 |
Infinity | SQLException is thrown | |
-Infinity | SQLException is thrown | |
NaN | SQLException is thrown | |
Byte.MIN_VALUE or greater and Byte.MAX_VALUE or less | Integer part of the retrieval result converted to a byte value | |
Other than the above | SQLException is thrown | |
FLOAT | NULL | 0 |
Infinity | SQLException is thrown | |
-Infinity | SQLException is thrown | |
NaN | SQLException is thrown | |
Byte.MIN_VALUE or greater and Byte.MAX_VALUE or less | Integer part of the retrieval result converted to a byte value | |
Other than the above | SQLException is thrown | |
DECIMAL | NULL | 0 |
Byte.MIN_VALUE or greater and Byte.MAX_VALUE or less | Integer part of the retrieval result converted to a byte value | |
Other than the above | SQLException is thrown | |
BOOLEAN# | NULL | 0 |
true | 1 | |
false | 0 | |
Other | -- | SQLException is thrown |
Legend:
--: Not applicable
#: There is BOOLEAN-type data when the Resultset was created from DatabaseMetadata.
public synchronized byte getByte(String columnName) throws SQLException
public synchronized byte[] getBytes(int columnIndex) throws SQLException
HiRDB data type | Retrieval result | Return value |
---|---|---|
[M|N][VAR]CHARBINARYBLOB | NULL | null |
Other than the above | Retrieval result converted to a byte array | |
Other | -- | SQLException is thrown |
public synchronized byte[] getBytes (String columnName) throws SQLException
public synchronized Reader getCharacterStream (int columnIndex) throws SQLException
HiRDB data type | Retrieval result | Return value |
---|---|---|
[M|N][VAR]CHARBINARYBLOB | NULL | null |
Other than the above | Reader object containing the retrieval result | |
Other | -- | SQLException is thrown |
public synchronized Reader getCharacterStream (String columnName) throws SQLException
public synchronized int getConcurrency() throws SQLException
public synchronized String getCursorName() throws SQLException
public synchronized java.sql.Date getDate(int columnIndex) throws SQLException
HiRDB data type | Retrieval result | Return value |
---|---|---|
[M|N][VAR]CHAR | NULL | null |
[single-byte-space]date-format[single-byte-space] | Retrieval result converted to a java.sql.Date object without the single-byte spaces at the beginning and end of the retrieval result | |
Other than the above | SQLException is thrown | |
DATE | NULL | null |
Other than the above | Retrieval result converted to a java.sql.Date object | |
TIMESTAMP | NULL | null |
Other than the above | Retrieval result converted to a java.sql.Date object | |
Other | -- | SQLException is thrown |
public synchronized java.sql.Date getDate(int columnIndex, Calendar cal) throws SQLException
public synchronized java.sql.Date getDate (String columnName) throws SQLException
public synchronized java.sql.Date getDate(String columnName, Calendar cal) throws SQLException
public synchronized double getDouble (int columnIndex) throws SQLException
HiRDB data type | Retrieval result | Return value |
---|---|---|
[M|N][VAR]CHAR | NULL | 0.0 |
[single-byte-space]integer-in-character-string-representation[single-byte-space], [single-byte-space]decimal-number-in-character-string-representation[single-byte-space], or [single-byte-space]floating-point-number-in-character-string-representation[single-byte-space], and -Double.MAX_VALUE or greater, and -Double.MAX_VALUE or greater, and Double.MIN_VALUE or less, and Double.MIN_VALUE or greater, and Double.MAX_VALUE or less | Retrieval result converted to a double value | |
[single-byte-space]integer-in-character-string-representation[single-byte-space], [single-byte-space]decimal-number-in-character-string-representation[single-byte-space], or [single-byte-space]floating-point-number-in-character-string-representation[single-byte-space], and greater than Double.MAX_VALUE | Infinity | |
[single-byte-space]integer-in-character-string-representation[single-byte-space], [single-byte-space]decimal-number-in-character-string-representation[single-byte-space], or [single-byte-space]floating-point-number-in-character-string-representation[single-byte-space], and less than -Double.MAX_VALUE | -Infinity | |
[single-byte-space]integer-in-character-string-representation[single-byte-space], [single-byte-space]decimal-number-in-character-string-representation[single-byte-space], or [single-byte-space]floating-point-number-in-character-string-representation[single-byte-space], and less than Double.MIN_VALUE, and greater than 0 | 0.0 | |
[single-byte-space]integer-in-character-string-representation[single-byte-space], [single-byte-space]decimal-number-in-character-string-representation[single-byte-space], or [single-byte-space]floating-point-number-in-character-string-representation[single-byte-space], and greater than -Double.MIN_VALUE, and less than 0 | -0.0 | |
[single-byte-space]-Infinity[single-byte-space] | -Infinity | |
[single-byte-space][+]Infinity[single-byte-space] | Infinity | |
[single-byte-space][+|-]NaN[single-byte-space] | NaN | |
Other than the above (double value cannot be obtained) | SQLException is thrown | |
SMALLINT | NULL | 0.0 |
Other than the above | Retrieval result converted to a double value | |
INTEGER | NULL | 0 |
Other than the above | Retrieval result converted to a double value | |
REAL | NULL | 0.0 |
Infinity | Infinity | |
-Infinity | -Infinity | |
NaN | NaN | |
Other than the above | Retrieval result converted to a double value | |
FLOAT | NULL | 0.0 |
Infinity | Infinity | |
-Infinity | -Infinity | |
NaN | NaN | |
Other than the above | Retrieval result converted to a double value | |
DECIMAL | NULL | 0 |
Other than the above | Retrieval result converted to a double value | |
BOOLEAN# | NULL | 0.0 |
true | 1.0 | |
false | 0.0 | |
Other | -- | SQLException is thrown |
Legend:
--: Not applicable
#: There is BOOLEAN-type data when the Resultset was created from DatabaseMetadata.
public synchronized double getDouble (String columnName) throws SQLException
public synchronized int getFetchDirection() throws SQLException
public synchronized int getFetchSize() throws SQLException
public synchronized float getFloat (int columnIndex) throws SQLException
HiRDB data type | Retrieval result | Return value |
---|---|---|
[M|N][VAR]CHAR | NULL | 0.0 |
[single-byte-space]integer-in-character-string-representation[single-byte-space], [single-byte-space]decimal-number-in-character-string-representation[single-byte-space], or [single-byte-space]floating-point-number-in-character-string-representation[single-byte-space], and one of the following:
|
Retrieval result converted to a float value | |
[single-byte-space]integer-in-character-string-representation[single-byte-space], [single-byte-space]decimal-number-in-character-string-representation[single-byte-space], or [single-byte-space]floating-point-number-in-character-string-representation[single-byte-space], and greater than Float.MAX_VALUE | Infinity | |
[single-byte-space]integer-in-character-string-representation[single-byte-space], [single-byte-space]decimal-number-in-character-string-representation[single-byte-space], or [single-byte-space]floating-point-number-in-character-string-representation[single-byte-space], and less than -Float.MAX_VALUE | -Infinity | |
[single-byte-space]integer-in-character-string-representation[single-byte-space], [single-byte-space]decimal-number-in-character-string-representation[single-byte-space], or [single-byte-space]floating-point-number-in-character-string-representation[single-byte-space], and less than Float.MIN_VALUE, and greater than 0 | 0.0 | |
[single-byte-space]integer-in-character-string-representation[single-byte-space], [single-byte-space]decimal-number-in-character-string-representation[single-byte-space], or [single-byte-space]floating-point-number-in-character-string-representation[single-byte-space], and greater than -Float.MIN_VALUE, and less than 0 | -0.0 | |
[single-byte-space]-Infinity[single-byte-space] | -Infinity | |
[single-byte-space][+]Infinity[single-byte-space] | Infinity | |
[single-byte-space][+|-]NaN[single-byte-space] | NaN | |
Other than the above (cannot be converted to a float value) | SQLException is thrown | |
SMALLINT | NULL | 0.0 |
Other than the above | Retrieval result converted to a float value | |
INTEGER | NULL | 0.0 |
Other than the above | Retrieval result converted to a float value | |
REAL | NULL | 0.0 |
Infinity | Infinity | |
-Infinity | -Infinity | |
NaN | NaN | |
Other than the above | Retrieval result | |
FLOAT | NULL | 0.0 |
Infinity | Infinity | |
-Infinity | -Infinity | |
NaN | NaN | |
-Float.MAX_VALUE or greater and -Float.MIN_VALUE or less, or Float.MIN_VALUE or greater and Float.MAX_VALUE or less | Retrieval result converted to a float value | |
Greater than Float.MAX_VALUE | Infinity | |
Less than -Float.MAX_VALUE | -Infinity | |
Less than Float.MIN_VALUE and greater than 0 | 0.0 | |
Greater than -Float.MIN_VALUE and less than 0 | -0.0 | |
DECIMAL | NULL | 0.0 |
Other than the above | Retrieval result converted to a float value | |
BOOLEAN# | NULL | 0.0 |
true | 1.0 | |
false | 0.0 | |
Other | -- | SQLException is thrown |
Legend:
--: Not applicable
#: There is BOOLEAN-type data when the Resultset was created from DatabaseMetadata.
public synchronized float getFloat (String columnName) throws SQLException
public synchronized int getInt(int columnIndex) throws SQLException
HiRDB data type | Retrieval result | Return value |
---|---|---|
[M|N][VAR]CHAR | NULL | 0 |
[single-byte-space]integer-in-character-string-representation[single-byte-space], [single-byte-space]decimal-number-in-character-string-representation[single-byte-space], or [single-byte-space]floating-point-number-in-character-string-representation[single-byte-space], and Integer.MIN_VALUE or greater, and Integer.MAX_VALUE or less | Integer part of the retrieval result converted to an int value | |
[single-byte-space]integer-in-character-string-representation[single-byte-space], [single-byte-space]decimal-number-in-character-string-representation[single-byte-space], or [single-byte-space]floating-point-number-in-character-string-representation[single-byte-space], and greater than Integer.MAX_VALUE or less than Integer.MIN_VALUE | SQLException is thrown | |
[single-byte-space]-Infinity[single-byte-space] | SQLException is thrown | |
[single-byte-space][+]Infinity[single-byte-space] | SQLException is thrown | |
[single-byte-space][+|-]NaN[single-byte-space] | SQLException is thrown | |
Other than the above (double value cannot be obtained) | SQLException is thrown | |
SMALLINT | NULL | 0 |
Other than the above | Retrieval result converted to an int value | |
INTEGER | NULL | 0 |
Other than the above | Retrieval result converted to an int value | |
REAL | NULL | 0 |
Infinity | SQLException is thrown | |
-Infinity | SQLException is thrown | |
NaN | SQLException is thrown | |
Integer.MIN_VALUE or greater and Integer.MAX_VALUE or less | Integer part of the retrieval result converted to an int value | |
Other than the above | SQLException is thrown | |
FLOAT | NULL | 0 |
Infinity | SQLException is thrown | |
-Infinity | SQLException is thrown | |
NaN | SQLException is thrown | |
Integer.MIN_VALUE or greater and Integer.MAX_VALUE or less | Integer part of the retrieval result converted to an int value | |
Other than the above | SQLException is thrown | |
DECIMAL | NULL | 0 |
Integer.MIN_VALUE or greater and Integer.MAX_VALUE or less | Integer part of the retrieval result converted to an int value | |
Other than the above | SQLException is thrown | |
BOOLEAN# | NULL | 0 |
true | 1 | |
false | 0 | |
Other | -- | SQLException is thrown |
Legend:
--: Not applicable
#: There is BOOLEAN-type data when the Resultset was created from DatabaseMetadata.
public synchronized int getInt(String columnName) throws SQLException
public synchronized double getLong (int columnIndex) throws SQLException
HiRDB data type | Retrieval result | Return value |
---|---|---|
[M|N][VAR]CHAR | NULL | 0 |
[single-byte-space]integer-in-character-string-representation[single-byte-space] and 15 characters or less, or [single-byte-space]decimal-number-in-character-string-representation[single-byte-space] and 15 characters or less | Integer part of the retrieval result converted to a long value | |
[single-byte-space]integer-in-character-string-representation[single-byte-space] and 16 characters or more, or [single-byte-space]decimal-number-in-character-string-representation[single-byte-space] and 16 characters or more, or [single-byte-space]floating-point-number-in-character-string-representation[single-byte-space], and Long.MIN_VALUE or greater, and Long.MAX_VALUE or less | Integer part of the retrieval result converted to a long value | |
[single-byte-space]integer-in-character-string-representation[single-byte-space] and 16 characters or more, or [single-byte-space]decimal-number-in-character-string-representation[single-byte-space] and 16 characters or more, or [single-byte-space]floating-point-number-in-character-string-representation[single-byte-space], greater than Long.MAX_VALUE or less than Long.MIN_VALUE | SQLException is thrown | |
[single-byte-space]-Infinity[single-byte-space] | SQLException is thrown | |
[single-byte-space][+]Infinity[single-byte-space] | SQLException is thrown | |
[single-byte-space][+|-]NaN[single-byte-space] | SQLException is thrown | |
Other than the above (cannot be converted to a double value or BigDecimal object) | SQLException is thrown | |
SMALLINT | NULL | 0 |
Other than the above | Retrieval result converted to a long value | |
INTEGER | NULL | 0 |
Other than the above | Retrieval result converted to a long value | |
REAL | NULL | 0 |
Infinity | SQLException is thrown | |
-Infinity | SQLException is thrown | |
NaN | SQLException is thrown | |
Long.MIN_VALUE or greater and Long.MAX_VALUE or less | Integer part of the retrieval result converted to a long value | |
Other than the above | SQLException is thrown | |
FLOAT | NULL | 0 |
Infinity | SQLException is thrown | |
-Infinity | SQLException is thrown | |
NaN | SQLException is thrown | |
Long.MIN_VALUE or greater and Long.MAX_VALUE or less | Integer part of the retrieval result converted to a long value | |
Other than the above | SQLException is thrown | |
DECIMAL | NULL | 0 |
Long.MIN_VALUE and greater and Long.MAX_VALUE and less | Integer part of the retrieval result converted to a long value | |
BINARYBLOB | NULL | 0 |
Data with a length of 0 | 0 | |
1 byte or more | Maximum of 8 bytes converted to a long value in little endian format | |
BOOLEAN# | NULL | 0 |
true | 1 | |
false | 0 | |
Other | -- | SQLException is thrown |
Legend:
--: Not applicable
#: There is BOOLEAN-type data when the Resultset was created from DatabaseMetadata.
public synchronized double getLong (String columnName) throws SQLException
public synchronized ResultSetMetaData getMetaData() throws SQLException
public synchronized Object getObject (int columnIndex) throws SQLException
HiRDB data type | Retrieval result | Return value |
---|---|---|
[M|N][VAR]CHAR | NULL | null |
Other than the above | Retrieval result | |
SMALLINT | NULL | null |
Other than the above | Integer object created by using the retrieval result | |
INTEGER | NULL | null |
Other than the above | Integer object created by using the retrieval result | |
REAL | NULL | null |
Other than the above | Float object created by using the retrieval result | |
FLOAT | NULL | null |
Other than the above | Double object created by using the retrieval result | |
DECIMAL | NULL | null |
Other than the above | Retrieval result | |
DATE | NULL | null |
Other than the above | java.sql.Date object created by using the retrieval result | |
TIME | NULL | null |
Other than the above | java.sql.Time object created by using the retrieval result | |
TIMESTAMP | NULL | null |
Other than the above | java.sql.Timestamp object created by using the retrieval result | |
BINARYBLOB | NULL | null |
Other than the above | Retrieval result | |
BOOLEAN# | NULL | null |
Non-NULL | Boolean object created by using the retrieval result |
#: There is BOOLEAN-type data when the Resultset was created from DatabaseMetadata.
public synchronized Object getObject (String columnName) throws SQLException
public synchronized int getRow() throws SQLException
public synchronized short getShort(int columnIndex) throws SQLException
HiRDB data type | Retrieval result | Return value |
---|---|---|
[M|N][VAR]CHAR | NULL | 0 |
[single-byte-space]integer-in-character-string-representation[single-byte-space], [single-byte-space]decimal-number-in-character-string-representation[single-byte-space], or [single-byte-space]floating-point-number-in-character-string-representation[single-byte-space], and Short.MIN_VALUE or greater, and Short.MAX_VALUE or less | Integer part of the retrieval result converted to a short value | |
[single-byte-space]integer-in-character-string-representation[single-byte-space], [single-byte-space]decimal-number-in-character-string-representation[single-byte-space], or [single-byte-space]floating-point-number-in-character-string-representation[single-byte-space], and greater than Short.MAX_VALUE or less than Short.MIN_VALUE | SQLException is thrown | |
[single-byte-space]-Infinity[single-byte-space] | SQLException is thrown | |
[single-byte-space][+]Infinity[single-byte-space] | SQLException is thrown | |
[single-byte-space][+|-]NaN[single-byte-space] | SQLException is thrown | |
Other than the above (double value cannot be obtained) | SQLException is thrown | |
SMALLINT | NULL | 0 |
Other than the above | Retrieval result | |
INTEGER | NULL | 0 |
Short.MIN_VALUE or greater and Short.MAX_VALUE or less | Retrieval result converted to a short value | |
Other than the above | SQLException is thrown | |
REAL | NULL | 0 |
Infinity | SQLException is thrown | |
-Infinity | SQLException is thrown | |
NaN | SQLException is thrown | |
Short.MIN_VALUE or greater and Short.MAX_VALUE or less | Integer part of the retrieval result converted to a short value | |
Other than the above | SQLException is thrown | |
FLOAT | NULL | 0 |
Infinity | SQLException is thrown | |
-Infinity | SQLException is thrown | |
NaN | SQLException is thrown | |
Short.MIN_VALUE or greater and Short.MAX_VALUE or less | Integer part of the retrieval result converted to a short value | |
Other than the above | SQLException is thrown | |
DECIMAL | NULL | 0 |
Short.MIN_VALUE and greater and Short.MAX_VALUE or less | Integer part of the retrieval result converted to a short value | |
Other than the above | SQLException is thrown | |
BOOLEAN# | NULL | 0 |
true | 1 | |
false | 0 | |
Other | -- | SQLException is thrown |
Legend:
--: Not applicable
#: There is BOOLEAN-type data when the Resultset was created from DatabaseMetadata.
public synchronized short getShort (String columnName) throws SQLException
public synchronized Statement getStatement() throws SQLException
public synchronized String getString(int columnIndex) throws SQLException
HiRDB data type | Retrieval result | Return value |
---|---|---|
[M|N][VAR]CHAR | NULL | null |
Other than the above | Retrieval result | |
SMALLINT | NULL | null |
Other than the above | String object containing the retrieval result in character string representation | |
INTEGER | NULL | null |
Other than the above | String object containing the retrieval result in character string representation | |
REAL | NULL | null |
Infinity | String object of the character string "Infinity" | |
-Infinity | String object of the character string "-Infinity" | |
NaN | String object of the character string "NaN" | |
Other than the above | String object containing the retrieval result in character string representation | |
FLOAT | NULL | null |
Infinity | String object of the character string "Infinity" | |
-Infinity | String object of the character string "-Infinity" | |
NaN | String object of the character string "NaN" | |
Other than the above | String object containing the retrieval result in character string representation | |
DECIMAL | NULL | null |
Other than the above | String object containing the retrieval result in character string representation | |
DATE | NULL | null |
Other than the above | String object of a character string in yyyy-MM-DD format acquired by JdbConvert.convertDate() | |
TIME | NULL | null |
Other than the above | String object of a character string in hh:mm:ss format | |
TIMESTAMP | NULL | null |
Other than the above | String object of a character string in yyyy-MM-DD |
|
BINARYBLOB | NULL | null |
Other than the above | String object obtained as the retrieval result | |
BOOLEAN# | NULL | null |
true | String object of the character string "true" | |
false | String object of the character string "false" |
#: There is BOOLEAN-type data when the Resultset was created from DatabaseMetadata.
public synchronized String getString(String columnName) throws SQLException
public synchronized java.sql.Time getTime(int columnIndex) throws SQLException
HiRDB data type | Retrieval result | Return value |
---|---|---|
[M|N][VAR]CHAR | NULL | null |
[single-byte-space]time-format[single-byte-space] | Value obtained by removing single-byte spaces at the beginning and end of the retrieval result and then converting to a java.sql.Time object | |
Other than the above | SQLException | |
TIME | NULL | null |
Other than the above | Retrieval result converted to a java.sql.Time object | |
TIMESTAMP | NULL | null |
Other than the above | Retrieval result converted to a java.sql.Time object | |
Other | -- | SQLException |
public synchronized java.sql.Time getTime (int columnIndex, Calendar cal) throws SQLException
public synchronized java.sql.Time getTime (String columnName) throws SQLException
public synchronized java.sql.Time getTime (String columnName, Calendar cal) throws SQLException
public synchronized java.sql.Timestamp getTimestamp (int columnIndex) throws SQLException
HiRDB data type | Retrieval result | Return value |
---|---|---|
[M|N][VAR]CHAR | NULL | null |
[single-byte-space]timestamp-format[single-byte-space] | Value obtained by removing single-byte spaces at the beginning and end of the retrieval result and then converting to a java.sql.Timestamp object | |
Other than the above | SQLException is thrown | |
DATE | NULL | null |
Other than the above | Retrieval result converted to a java.sql.Timestamp object | |
TIMESTAMP | NULL | null |
Other than the above | Retrieval result converted to a java.sql.Timestamp object | |
Other | -- | SQLException is thrown |
public synchronized java.sql.Timestamp getTimestamp (int columnIndex, Calendar cal) throws SQLException
public synchronized java.sql.Timestamp getTimestamp (String columnName) throws SQLException
public synchronized java.sql.Timestamp getTimestamp (String columnName, Calendar cal) throws SQLException
public synchronized int getType() throws SQLException
public synchronized SQLWarning getWarnings() throws SQLException
public synchronized boolean isAfterLast() throws SQLException
public synchronized boolean isBeforeFirst() throws SQLException
public synchronized boolean isFirst() throws SQLException
public synchronized boolean isLast() throws SQLException
public synchronized boolean last() throws SQLException
public synchronized boolean next() throws SQLException
public synchronized boolean previous() throws SQLException
public synchronized boolean relative(int rows) throws SQLException
public synchronized void setFetchDirection(int direction) throws SQLException
public synchronized void setFetchSize(int rows) throws SQLException
public synchronized boolean wasNull() throws SQLException
The names of the package and class for installing this interface are as follows:
The following table lists the fields supported by the ResultSet interface.
Table 18-31 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 18.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 18.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 the following table.
Table 18-32 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 the following table.
Table 18-33 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.
The following table 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 the following table.
Table 18-34 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 |
Tables 18-35 and 18-36 show the return values of a getXXXX method for HiRDB data types when the default null value setting facility is used (by specifying USE in the PDDFLNVAL client environment definition) and the retrieval result is the default null value.
For details about the default null value setting facility, see the manual HiRDB Version 9 SQL Reference.
When the default null value setting facility is used, the wasNull method returns FALSE.
Note that the default null value setting facility is not applicable to a ResultSet object that has been acquired by a method of the DatabaseMetaData class. Therefore, the JDBC driver sets NULL as the getXXXX method's return value even if the default null value setting facility is used.
Table 18-35 Return value of a getXXXX method for HiRDB data types when the retrieval result is the default null value (1/2)
getXXX method | HiRDB data type | ||||
---|---|---|---|---|---|
[M|N][VAR]CHAR | BINARY BLOB |
DATE | TIME | TIMESTAMP | |
getByte | -- | -- | -- | -- | -- |
getShort | -- | -- | -- | -- | -- |
getInt | -- | -- | -- | -- | -- |
getLong | -- | -- | -- | -- | -- |
getFloat | -- | -- | -- | -- | -- |
getDouble | -- | -- | -- | -- | -- |
getBigDecimal | -- | -- | -- | -- | -- |
getBoolean | FALSE | -- | -- | -- | -- |
getString | Default NULL value | String object of the default NULL value | String object of a character string in yyyy-MM-DD format obtained by converting the default NULL value | String object of a character string in hh:mm:ss format obtained by converting the default NULL value | String object of a character string in yyyy-MM-DD |
getBytes | Default NULL value converted to a byte array | Same as left | -- | -- | -- |
getDate | -- | -- | Default NULL value converted to a java.sql.Date object | -- | Default NULL value converted to a java.sql.Date object |
getTime | -- | -- | -- | Default NULL value converted to a java.sql.Time object | Same as left |
getTimestamp | -- | -- | Default NULL value converted to a java.sql.Timestamp object | -- | Default NULL value converted to a java.sql.Timestamp object |
getAsciiStream | InputStream object containing the default NULL value | Same as left | -- | -- | -- |
getBinaryStream | -- | InputStream object containing the default NULL value | -- | -- | -- |
getObject | Default NULL value | Same as left | java.sql.Date object created by the default NULL value | java.sql.Time object created by the default NULL value | java.sql.Timestamp object created by the default NULL value |
getCharacterStream | Reader object containing the default NULL value | Same as left | -- | -- | -- |
getArray | -- | -- | -- | -- | -- |
getBlob | -- | java.sql.Blob object that has the default NULL value | -- | -- | -- |
Table 18-36 Return value of a getXXXX method for HiRDB data types when the retrieval result is the default null value (2/2)
getXXX method | JDBC SQL type | |||||
---|---|---|---|---|---|---|
SMALLINT | INTEGER | REAL | FLOAT | DECIMAL | ARRAY | |
getByte | Default NULL value converted to a byte value | Same as left | Same as left | Same as left | Same as left | -- |
getShort | Default NULL value | Default NULL value converted to a short value | Integer part of the default NULL value converted to a short value | Same as left | Same as left | -- |
getInt | Default NULL value converted to an int value | Same as left | Integer part of the default NULL value converted to an int value | Same as left | Same as left | -- |
getLong | Default NULL value converted to a long value | Same as left | Integer part of the default NULL value converted to a long value | Same as left | Same as left | -- |
getFloat | Default NULL value converted to a float value | Same as left | Same as left | Same as left | Same as left | -- |
getDouble | Default NULL value converted to a double value | Same as left | Same as left | Same as left | Same as left | -- |
getBigDecimal | BigDecimal object that has the default NULL value | Same as left | Same as left | Same as left | Same as left | -- |
getBoolean | FALSE | Same as left | Same as left | Same as left | Same as left | -- |
getString | String object containing the default NULL value in character string representation | Same as left | Same as left | Same as left | Same as left | -- |
getBytes | -- | -- | -- | -- | -- | -- |
getDate | -- | -- | -- | -- | -- | -- |
getTime | -- | -- | -- | -- | -- | -- |
getTimestamp | -- | -- | -- | -- | -- | -- |
getAsciiStream | -- | -- | -- | -- | -- | -- |
getBinaryStream | -- | -- | -- | -- | -- | -- |
getObject | Integer object created by the default NULL value | Same as left | Float object created by the default NULL value | Double object created by the default NULL value | Default NULL value | Array object created by the default NULL value |
getCharacterStream | -- | -- | -- | -- | -- | -- |
getArray | -- | -- | -- | -- | -- | java.sql.Array object containing no element |
getBlob | -- | -- | -- | -- | -- | -- |
All Rights Reserved. Copyright (C) 2011, Hitachi, Ltd.