The interface used to execute remote SQL stored procedures. The result parameter must be registered as an OUT parameter. The other parameters can be used for input, output or both. Parameters are referred to sequentially, by number. The first parameter is 1.
See The remote query and stored procedure adapter for more details.
call <procedure-name> (?,?, ...)
IN parameter values are set using the set methods inherited from PreparedStatement. The type of all OUT parameters must be registered prior to executing the stored procedure; their values are retrieved after execution via the get methods provided here. The size of the output parameter is limited to 4K bytes.
A CallableStatement can return one ResultSet.
java.sql package
public interface CallableStatement
extends PreparedStatement
Tabulka 113 lists the methods in the CallableStatement interface that
are supported by DB2 Everyplace.
Tabulka 113. CallableStatement interface methods
Method return value type | Method |
---|---|
Blob | getBlob(int i) JDBC 2.0 Gets the value of a JDBC BLOB parameter as a Blob object in the Java programming language. |
byte[] | getBytes(int parameterIndex) Gets the value of a JDBC BINARY or VARBINARY parameter as an array of byte values in the Java programming language. |
Date | getDate(int parameterIndex) Gets the value of a JDBC DATE parameter as a java.sql.Date object. |
int | getInt(int parameterIndex) Gets the value of a JDBC INTEGER parameter as an int in the Java programming language. |
Object | getObject(int parameterIndex) Gets the value of a parameter as an object in the Java programming language. |
short | getShort(int parameterIndex) Gets the value of a JDBC SMALLINT parameter as a short in the Java programming language. |
String | getString(int parameterIndex) Retrieves the value of a JDBC CHAR, VARCHAR, or LONGVARCHAR parameter as a String in the Java programming language. |
Time | getTime(int parameterIndex) Gets the value of a JDBC TIME parameter as a java.sql.Time object. |
Timestamp | getTimestamp(int parameterIndex) Gets the value of a JDBC TIMESTAMP parameter as a java.sql.Timestamp object. |
void | registerOutParameter(int parameterIndex, int sqlType) Registers the OUT parameter in ordinal position parameterIndex to the JDBC type sqlType. |
boolean | wasNull() Indicates whether or not the last OUT parameter read had the value of SQL NULL. |
Související úlohy
Související odkazy