Nonstop Database, HiRDB Version 9 UAP Development Guide
The CallableStatement interface provides the following main functions:
The CallableStatement class inherits all the functions of the PreparedStatement and Statement classes because the CallableStatement class is a subclass of the PreparedStatement class.
The table below lists the methods of the CallableStatement 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-25 CallableStatement interface methods
| Subsection | Method | Function |
|---|---|---|
| (a) | getBigDecimal(int parameterIndex) | Acquires the value of a specified ? parameter as a java.math.BigDecimal object in Java programming language. |
| (b) | getBigDecimal(int parameterIndex,int scale) | Acquires the value of a specified ? parameter as a java.math.BigDecimal object in Java programming language, with as many decimal places as are specified in scale. |
| (c) | getBlob(int parameterIndex) | Acquires the value of a specified ? parameter as a java.sql.Blob object in Java programming language. |
| (d) | getBlob(String parameterName) | Acquires the value of a specified ? parameter as a java.sql.Blob object in Java programming language. |
| (e) | getBoolean(int parameterIndex) | Acquires the value of a specified ? parameter as boolean in Java programming language. |
| (f) | getBoolean(String parameterName) | Acquires the value of a specified ? parameter as boolean in Java programming language. |
| (g) | getByte(int parameterIndex) | Acquires the value of a specified ? parameter as byte in Java programming language. |
| (h) | getByte(String parameterName) | Acquires the value of a specified ? parameter as byte in Java programming language. |
| (i) | getBytes(int parameterIndex) | Acquires the value of a specified ? parameter as a byte array in Java programming language. |
| (j) | getBytes(String parameterName) | Acquires the value of a specified ? parameter as a byte array in Java programming language. |
| (k) | getDate(int parameterIndex) | Acquires the value of a specified ? parameter as a java.sql.Date object in Java programming language. |
| (l) | getDate(int parameterIndex, java.util.Calendar cal) | Acquires the value of a specified ? parameter as a java.sql.Date object in Java programming language. |
| (m) | getDate(String parameterName) | Acquires the value of a specified ? parameter as a java.sql.Date object in Java programming language. |
| (n) | getDate(String parameterName, java.util.Calendar cal) | Acquires the value of a specified ? parameter as a java.sql.Date object in Java programming language. |
| (o) | getDouble(int parameterIndex) | Acquires the value of a specified ? parameter as double in Java programming language. |
| (p) | getDouble(String parameterName) | Acquires the value of a specified ? parameter as double in Java programming language. |
| (q) | getFloat(int parameterIndex) | Acquires the value of a specified ? parameter as float in Java programming language. |
| (r) | getFloat(String parameterName) | Acquires the value of a specified ? parameter as float in Java programming language. |
| (s) | getInt(int parameterIndex) | Acquires the value of a specified ? parameter as int in Java programming language. |
| (t) | getInt(String parameterName) | Acquires the value of a specified ? parameter as int in Java programming language. |
| (u) | getLong(int parameterIndex) | Acquires the value of a specified ? parameter as long in Java programming language. |
| (v) | getLong(String parameterName) | Acquires the value of a specified ? parameter as long in Java programming language. |
| (w) | getObject(int parameterIndex) | Acquires the value of a specified ? parameter as java.lang.Object in Java programming language. |
| (x) | getObject(String parameterName) | Acquires the value of a specified ? parameter as java.lang.Object in Java programming language. |
| (y) | getShort(int parameterIndex) | Acquires the value of a specified ? parameter as short in Java programming language. |
| (z) | getShort(String parameterName) | Acquires the value of a specified ? parameter as short in Java programming language. |
| (aa) | getString(int parameterIndex) | Acquires the value of a specified ? parameter as a java.lang.String object in Java programming language. |
| (ab) | getString(String parameterName) | Acquires the value of a specified ? parameter as a java.lang.String object in Java programming language. |
| (ac) | getTime(int parameterIndex) | Acquires the value of a specified ? parameter as a java.sql.Time object in Java programming language. |
| (ad) | getTime(int parameterIndex, java.util.Calendar cal) | Acquires the value of a specified ? parameter as a java.sql.Time object in Java programming language. |
| (ae) | getTime (String parameterName) | Acquires the value of a specified ? parameter as a java.sql.Time object in Java programming language. |
| (af) | getTime(String parameterName, java.util.Calendar cal) | Acquires the value of a specified ? parameter as a java.sql.Time object in Java programming language. |
| (ag) | getTimestamp(int parameterIndex) | Acquires the value of a specified ? parameter as a java.sql.Timestamp object in Java programming language. |
| (ah) | getTimestamp(int parameterIndex, java.util.Calendar cal) | Acquires the value of a specified ? parameter as a java.sql.Timestamp object in Java programming language. |
| (ai) | getTimestamp (String parameterName) | Acquires the value of specified ? parameter as a java.sql.Timestamp object in Java programming language. |
| (aj) | getTimestamp(String parameterName, java.util.Calendar cal) | Acquires the value of a specified ? parameter as a java.sql.Timestamp object in Java programming language. |
| (ak) | registerOutParameter(int parameterIndex,int sqlType) | Registers the data type of a specified OUT parameter as a specified JDBC type. |
| (al) | registerOutParameter(int parameterIndex,int sqlType,int scale) | Registers the data type of a specified OUT parameter as a specified JDBC type. |
| (am) | registerOutParameter(String parameterName,int sqlType) | Registers the data type of a specified OUT parameter as a specified JDBC type. |
| (an) | registerOutParameter(String parameterName,int sqlType,int scale) | Registers the data type of a specified OUT parameter as a specified JDBC type. |
| (ao) | setAsciiStream(String parameterName, java.io.InputStream x, int length) | Sets the value of a java.io.InputStream object as a ? parameter value with a length no more than the length specified by length. |
| (ap) | setBigDecimal(String parameterName, java.math.BigDecimal x) | Sets a specified java.math.BigDecimal value as a ? parameter value. |
| (aq) | setBinaryStream(String parameterName, java.io.InputStream x, int length) | Acquires the value of a specified ? parameter as a java.math.BigDecimal object in Java programming language. |
| (ar) | setBoolean(String parameterName,boolean x) | Sets a specified boolean value as a ? parameter value. |
| (as) | setByte(String parameterName,byte x) | Sets a specified byte value as a ? parameter value. |
| (at) | setBytes(String parameterName,byte[] x) | Sets a specified byte array as a ? parameter value. |
| (au) | setCharacterStream(String parameterName,Reader x,int length) | Sets the value of a specified Reader object as a ? parameter value. |
| (av) | setDate(String parameterName, java.sql.Date x) | Sets the value of a java.sql.Date object as a ? parameter value. |
| (aw) | setDate(String parameterName, java.sql.Date x,Calendar cal) | Converts a java.sql.Date object specified in local time to the equivalent time value in a specified calendar's time zone, and then sets it as a ? parameter value. |
| (ax) | setDouble(String parameterName,double x) | Sets a specified double value as a ? parameter value. |
| (ay) | setFloat(String parameterName,float x) | Sets a specified float value as a ? parameter value. |
| (az) | setInt(String parameterName,int x) | Sets a specified int value as a ? parameter value. |
| (ba) | setLong(String parameterName,long x) | Sets a specified long value as a ? parameter value. |
| (bb) | setNull(String parameterName,int sqlType) | Sets the NULL value in a specified ? parameter. |
| (bc) | setObject(String parameterName,Object x) | Sets the value of a specified object as a ? parameter value. |
| (bd) | setObject(String parameterName,Object x,int targetSqlType) | Sets the value of a specified object as a ? parameter value. |
| (be) | setObject(String parameterName,Object x,int targetSqlType,int scale) | Sets the value of a specified object as a ? parameter value. |
| (bf) | setShort(String parameterName,short x) | Sets a specified short value as a ? parameter value. |
| (bg) | setString(String parameterName,String x) | Sets a specified String object as a ? parameter value. |
| (bh) | setTime(String parameterName,Time x) | Sets a specified java.sql.Time object as a ? parameter value. |
| (bi) | setTime(String parameterName, java.sql.Time x,Calendar cal) | Converts a java.sql.Time object specified in local time to the equivalent time value in a specified calendar's time zone, and then sets it as a ? parameter value. |
| (bj) | setTimestamp(String parameterName, java.sql.Timestamp x) | Sets a specified java.sql.Timestamp object as a ? parameter value. |
| (bk) | setTimestamp(String parameterName, java.sql.Timestamp x,Calendar cal) | Converts a java.sql.Timestamp object specified in local time to the equivalent time value in a specified calendar's time zone, and then sets it as a ? parameter value. |
| (bl) | wasNull() | Acquires a value indicating whether the value of the last OUT or INOUT parameter read was NULL. |
public synchronized java.math.BigDecimal getBigDecimal(int parameterIndex) throws SQLException
| HiRDB data type | ? parameter's value | 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 ? parameter value. 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 |
| Non-NULL | BigDecimal object containing the ? parameter value | |
| INTEGER | NULL | null |
| Non-NULL | BigDecimal object containing the ? parameter value | |
| REAL | NULL | null |
| Infinity | SQLException is thrown | |
| -Infinity | SQLException is thrown | |
| NaN | SQLException is thrown | |
| Other than the above | BigDecimal object containing the ? parameter value | |
| FLOAT | NULL | null |
| Infinity | SQLException is thrown | |
| -Infinity | SQLException is thrown | |
| NaN | SQLException is thrown | |
| Other than the above | BigDecimal object containing the ? parameter value | |
| DECIMAL | NULL | null |
| Non-NULL | BigDecimal object containing the ? parameter value. | |
| BOOLEAN | NULL | null |
| true | BigDecimal object obtained based on BigDecimal(1) | |
| false | BigDecimal object obtained based on BigDecimal(0) | |
| Other | -- | SQLException is thrown |
public synchronized java.math.BigDecimal getBigDecimal(int parameterIndex, int scale) throws SQLException
public synchronized java.sql.Blob getBlob(int parameterIndex) throws SQLException
| HiRDB data type | ? parameter value | Return value |
|---|---|---|
| BINARY BLOB |
NULL | null |
| Non-NULL | java.sql.Blob object containing the ? parameter's value | |
| Other | -- | SQLException is thrown |
public synchronized java.sql.Blob getBlob (String parameterName) throws SQLException
public synchronized boolean getBoolean(int parameterIndex) throws SQLException
| HiRDB data type | ? parameter value | Return value |
|---|---|---|
| [M][VAR]CHAR NVARCHAR |
NULL | false |
| [single-byte-space]true (in 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 (in 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 | |
| -Inifnity | true | |
| NaN | true | |
| 0.0 or -0.0 | false | |
| Other than the above | true | |
| FLOAT | NULL | false |
| Infinity | true | |
| -Inifnity | 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 | ? parameter value | |
| Other | -- | SQLException is thrown |
public synchronized boolean getBoolean (String parameterName) throws SQLException
public synchronized byte getByte(int parameterIndex) throws SQLException
| HiRDB data type | ? parameter value | 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 | ? parameter value 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 | ? parameter value 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 | ? parameter value 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 ? parameter 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 ? parameter 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 ? parameter converted to a byte value | |
| Other than the above | SQLException is thrown | |
| BOOLEAN | NULL | 0 |
| true | 1 | |
| false | 0 | |
| Other | -- | SQLException is thrown |
public synchronized byte getByte (String parameterName) throws SQLException
public synchronized byte[] getBytes(int parameterIndex) throws SQLException
| HiRDB data type | ? parameter value | Return value |
|---|---|---|
| [M|N][VAR]CHAR BINARY BLOB |
NULL | null |
| Non-NULL | ? parameter value converted to a byte array | |
| Other | -- | SQLException is thrown |
public synchronized byte[] getBytes(String parameterName) throws SQLException
public synchronized java.sql.Date getDate(int parameterIndex) throws SQLException
| HiRDB data type | ? parameter value | Return value |
|---|---|---|
| [M|N][VAR]CHAR | NULL | null |
| [single-byte-space]date-format[single-byte-space] | Value obtained by removing single-byte spaces at the beginning and end of the ? parameter value and then converting to the java.sql.Date object | |
| Other than the above | SQLException is thrown | |
| DATE | NULL | null |
| Non-NULL | ? parameter value converted to a java.sql.Date object | |
| TIMESTAMP | NULL | null |
| Non-NULL | ? parameter value converted to a java.sql.Date object | |
| Other | -- | SQLException is thrown |
public synchronized java.sql.Date getDate (int parameterIndex, java.util.Calendar cal) throws SQLException
public synchronized java.sql.Date getDate (String parameterName) throws SQLException
public synchronized java.sql.Date getDate (String parameterName, java.util.Calendar cal) throws SQLException
public synchronized double getDouble(int parameterIndex) throws SQLException
| HiRDB data type | ? parameter value | 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 | ? parameter value 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 |
| Non-NULL | ? parameter value converted to a double value | |
| INTEGER | NULL | 0 |
| Non-NULL | ? parameter value converted to a double value | |
| REAL | NULL | 0.0 |
| Infinity | Infinity | |
| -Infinity | -Infinity | |
| NaN | NaN | |
| Other than the above | ? parameter value converted to a double value | |
| FLOAT | NULL | 0.0 |
| Infinity | Infinity | |
| -Infinity | -Infinity | |
| NaN | NaN | |
| Other than the above | ? parameter value | |
| DECIMAL | NULL | 0 |
| Non-NULL | ? parameter value converted to a double value | |
| BOOLEAN | NULL | 0.0 |
| true | 1.0 | |
| false | 0.0 | |
| Other | -- | SQLException is thrown |
public synchronized double getDouble (String parameterName) throws SQLException
public synchronized float getFloat(int parameterIndex) throws SQLException
| HiRDB data type | ? parameter value | 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:
|
? parameter value 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 |
| Non-NULL | ? parameter value converted to a float value | |
| INTEGER | NULL | 0.0 |
| Non-NULL | ? parameter value converted to a float value | |
| REAL | NULL | 0.0 |
| Infinity | Infinity | |
| -Infinity | -Infinity | |
| NaN | NaN | |
| Other than the above | ? parameter value | |
| 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 | ? parameter value 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 |
| Non-NULL | ? parameter value converted to a float value | |
| BOOLEAN | NULL | 0.0 |
| true | 1.0 | |
| false | 0.0 | |
| Other | -- | SQLException is thrown |
public synchronized float getFloat (String parameterName) throws SQLException
public synchronized int getInt(int parameterIndex) throws SQLException
| HiRDB data type | ? parameter value | 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 ? parameter 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 |
| Non-NULL | ? parameter value converted to an int value | |
| INTEGER | NULL | 0 |
| Non-NULL | ? parameter 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 ? parameter 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 ? parameter 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 ? parameter converted to an int value | |
| Other than the above | SQLException is thrown | |
| BOOLEAN | NULL | 0 |
| true | 1 | |
| false | 0 | |
| Other | -- | SQLException is thrown |
public synchronized int getInt (String parameterName) throws SQLException
public synchronized long getlong(int parameterIndex) throws SQLException
| HiRDB data type | ? parameter value | 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 ? parameter 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 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 ? parameter 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 |
| Non-NULL | ? parameter value converted to a long value | |
| INTEGER | NULL | 0 |
| Non-NULL | ? parameter value 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 ? parameter 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 ? parameter 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 ? parameter converted to a long value | |
| Other than the above | SQLException is thrown | |
| BINARY BLOB |
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 |
public synchronized long getLong (String parameterName) throws SQLException
public synchronized Object getObject (int parameterIndex) throws SQLException
| HiRDB data type | ? parameter value | Return value |
|---|---|---|
| [M|N][VAR]CHAR | NULL | null |
| Non-NULL | ? parameter value | |
| SMALLINT | NULL | null |
| Non-NULL | Integer object created by the ? parameter value | |
| INTEGER | NULL | null |
| Non-NULL | Integer object created by the ? parameter value | |
| REAL | NULL | null |
| Non-NULL | Float object created by the ? parameter value | |
| FLOAT | NULL | null |
| Non-NULL | Double object created by the ? parameter value | |
| DECIMAL | NULL | null |
| Non-NULL | ? parameter value | |
| DATE | NULL | null |
| Non-NULL | java.sql.Date object created by the ? parameter value | |
| TIME | NULL | null |
| Non-NULL | java.sql.Time object created by the ? parameter value | |
| TIMESTAMP | NULL | null |
| Non-NULL | java.sql.Timestamp object created by the ? parameter value | |
| BINARY BLOB |
NULL | null |
| Non-NULL | ? parameter value | |
| BOOLEAN | NULL | null |
| Non-NULL | Boolean object created by the ? parameter value |
public synchronized Object getObject (String parameterName) throws SQLException
public synchronized short getShort(int parameterIndex) throws SQLException
| HiRDB data type | ? parameter value | 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 ? parameter 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 |
| Non-NULL | ? parameter value | |
| INTEGER | NULL | 0 |
| Short.MIN_VALUE or greater and Short.MAX_VALUE or less | ? parameter value 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 ? parameter 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 ? parameter 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 ? parameter converted to a short value | |
| Other than the above | SQLException is thrown | |
| BOOLEAN | NULL | 0 |
| true | 1 | |
| false | 0 | |
| Other | -- | SQLException is thrown |
public synchronized short getShort (String parameterName) throws SQLException
public synchronized String getString(int parameterIndex) throws SQLException
| HiRDB data type | ? parameter value | Return value |
|---|---|---|
| [M|N][VAR]CHAR | NULL | null |
| Non-NULL | ? parameter value. If the HiRDB_for_Java_DAB_CONVERT_NULL system property is set to TRUE and the ? parameter value is a character string with a length of 0, the return value is null. |
|
| SMALLINT | NULL | null |
| Non-NULL | String object with the ? parameter value in character string representation | |
| INTEGER | NULL | null |
| Non-NULL | String object with the ? parameter value 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 with the ? parameter value 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 with the ? parameter value in character string representation | |
| DECIMAL | NULL | null |
| Non-NULL | String object with the ? parameter value in character string representation | |
| DATE | NULL | null |
| Non-NULL | String object of a character string in yyyy-MM-DD format acquired by JdbConvert.convertDate() | |
| TIME | NULL | null |
| Non-NULL | String object of a character string in hh:mm:ss format | |
| TIMESTAMP | NULL | null |
| Non-NULL | String object of a character string in yyyy-MM-DD |
|
| BINARY BLOB |
NULL | null |
| Non-NULL | String object of the ? parameter value | |
| BOOLEAN | NULL | null |
| true | String object of the character string "true" | |
| false | String object of the character string "false" |
public synchronized String getString(String parameterName) throws SQLException
public synchronized java.sql.Time getTime(int parameterIndex) throws SQLException
| HiRDB data type | ? parameter value | 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 ? parameter value and then converting to a java.sql.Time object | |
| Other than the above | SQLException | |
| TIME | NULL | null |
| Non-NULL | ? parameter value converted to a java.sql.Time object | |
| TIMESTAMP | NULL | null |
| Non-NULL | ? parameter value converted to a java.sql.Time object | |
| Other | -- | SQLException |
public synchronized java.sql.Time getTime (int parameterIndex, java.util.Calendar cal) throws SQLException
public synchronized java.sql.Time getTime (String parameterName) throws SQLException
public synchronized java.sql.Time getTime (String parameterName, java.util.Calendar cal) throws SQLException
public synchronized java.sql.Timestamp getTimestamp (int parameterIndex) throws SQLException
| HiRDB data type | ? parameter value | 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 ? parameter value and converting to a java.sql.Timestamp object | |
| Other than the above | SQLException is thrown | |
| DATE | NULL | null |
| Non-NULL | ? parameter value converted to a java.sql.Timestamp object | |
| TIMESTAMP | NULL | null |
| Non-NULL | ? parameter value converted to a java.sql.Timestamp object | |
| Other | -- | SQLException is thrown |
public synchronized java.sql.Timestamp getTimestamp (int parameterIndex, java.util.Calendar cal) throws SQLException
public synchronized java.sql.Timestamp getTimestamp (String parameterName) throws SQLException
public synchronized java.sql.Timestamp getTimestamp (String parameterName, java.util.Calendar cal) throws SQLException
public synchronized void registerOutParameter(int parameterIndex, int sqlType) throws SQLException
public synchronized void registerOutParameter(int parameterIndex, int sqlType, int scale) throws SQLException
public synchronized void registerOutParameter(String parameterName, int sqlType) throws SQLException
public synchronized void registerOutParameter(String parameterName, int sqlType, int scale) throws SQLException
public synchronized void setAsciiStream(String parameterName, java.io.InputStream x, int length) throws SQLException
public synchronized void setBigDecimal(String parameterName, java.math.BigDecimal x) throws SQLException
public synchronized void setBinaryStream(String parameterName, java.io.InputStream x, int length) throws SQLException
public synchronized void setBoolean(String parameterName, boolean x) throws SQLException
public synchronized void setByte(String parameterName, byte x) throws SQLException
public synchronized void setBytes(String parameterName, byte[] x) throws SQLException
public synchronized void setCharacterStream(String parameterName, Reader x, int length) throws SQLException
public synchronized void setDate(String parameterName, java.sql.Date x) throws SQLException
public synchronized void setDate(String parameterName, java.sql.Date x,Calendar cal) throws SQLException
public synchronized void setDouble(String parameterName, double x) throws SQLException
public synchronized void setFloat(String parameterName, float x) throws SQLException
public synchronized void setInt(String parameterName, int x) throws SQLException
public synchronized void setLong(String parameterName, long x) throws SQLException
public synchronized void setNull(String parameterName,int sqlType) throws SQLException
public synchronized void setObject(String parameterName, Object x) throws SQLException
public synchronized void setObject(String parameterName, Object x, int targetSqlType) throws SQLException
public synchronized void setObject(String parameterName, Object x, int targetSqlType, int scale) throws SQLException
public synchronized void setShort(String parameterName, short x) throws SQLException
public synchronized void setString(String parameterName, String x) throws SQLException
| Data type of ? parameter | Value of ? parameter |
|---|---|
| [M|N][VAR]CHAR |
|
| BINARY or BLOB | Character string with a length of 0 |
| Other | null |
public synchronized void setTime(String parameterName, Time x) throws SQLException
public synchronized void setTime(String parameterName, java.sql.Time x,Calendar cal) throws SQLException
public synchronized void setTimestamp(String parameterName, java.sql.Timestamp x) throws SQLException
public synchronized void setTimestamp(String parameterName, java.sql.Timestamp x,Calendar cal) throws SQLException
public synchronized boolean wasNull() throws SQLException
Table 18-26 Return values
| Condition | Return value |
|---|---|
| Last parameter read was NULL. | true |
| Last parameter read was not NULL. | false |
| Before an execute-related method has executed (ResultSet for OUT parameter is null). | false |
| No get operation (getXXX) has been performed. | false |
| After clearParameters has executed. | Same value as before clearParameters executed |
| After an execute-related method has re-executed (spanning a close of ResultSet for an OUT parameter). | false |
The following are the package and class names for installing this interface:
If you use a registerOutParameter(int parameterIndex, int sqlType) method that does not accept decimal places to set a DECIMAL-type OUT or INOUT parameter, the number of digits will be assumed to be 0.
The following should be noted when a setXXX method is used to set a value in a ? parameter of HiRDB's DECIMAL type and the precision and scaling acquired by the CALL statement's preprocessing do not match the precision and scaling of the value:
All Rights Reserved. Copyright (C) 2011, Hitachi, Ltd.