java.sql
Interface CallableStatement

All Superinterfaces:
PreparedStatement sample code for java.sql.PreparedStatement definition code for java.sql.PreparedStatement , Statement sample code for java.sql.Statement definition code for java.sql.Statement

public interface CallableStatement
extends PreparedStatement sample code for java.sql.PreparedStatement definition code for java.sql.PreparedStatement

The interface used to execute SQL stored procedures. The JDBC API provides a stored procedure SQL escape syntax that allows stored procedures to be called in a standard way for all RDBMSs. This escape syntax has one form that includes a result parameter and one that does not. If used, 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, with the first parameter being 1.

   {?= call <procedure-name>[<arg1>,<arg2>, ...]}
   {call <procedure-name>[<arg1>,<arg2>, ...]}
 

IN parameter values are set using the set methods inherited from PreparedStatement sample code for java.sql.PreparedStatement definition code for java.sql.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.

A CallableStatement can return one ResultSet sample code for java.sql.ResultSet definition code for java.sql.ResultSet object or multiple ResultSet objects. Multiple ResultSet objects are handled using operations inherited from Statement sample code for java.sql.Statement definition code for java.sql.Statement .

For maximum portability, a call's ResultSet objects and update counts should be processed prior to getting the values of output parameters.

See Also:
Connection.prepareCall(java.lang.String) sample code for java.sql.Connection.prepareCall(java.lang.String) definition code for java.sql.Connection.prepareCall(java.lang.String) , ResultSet sample code for java.sql.ResultSet definition code for java.sql.ResultSet

Field Summary
 
Fields inherited from interface java.sql.Statement sample code for java.sql.Statement definition code for java.sql.Statement
CLOSE_ALL_RESULTS sample code for java.sql.Statement.CLOSE_ALL_RESULTS definition code for java.sql.Statement.CLOSE_ALL_RESULTS , CLOSE_CURRENT_RESULT sample code for java.sql.Statement.CLOSE_CURRENT_RESULT definition code for java.sql.Statement.CLOSE_CURRENT_RESULT , EXECUTE_FAILED sample code for java.sql.Statement.EXECUTE_FAILED definition code for java.sql.Statement.EXECUTE_FAILED , KEEP_CURRENT_RESULT sample code for java.sql.Statement.KEEP_CURRENT_RESULT definition code for java.sql.Statement.KEEP_CURRENT_RESULT , NO_GENERATED_KEYS sample code for java.sql.Statement.NO_GENERATED_KEYS definition code for java.sql.Statement.NO_GENERATED_KEYS , RETURN_GENERATED_KEYS sample code for java.sql.Statement.RETURN_GENERATED_KEYS definition code for java.sql.Statement.RETURN_GENERATED_KEYS , SUCCESS_NO_INFO sample code for java.sql.Statement.SUCCESS_NO_INFO definition code for java.sql.Statement.SUCCESS_NO_INFO
 
Method Summary
 Array sample code for java.sql.Array definition code for java.sql.Array getArray sample code for java.sql.CallableStatement.getArray(int) definition code for java.sql.CallableStatement.getArray(int) (int i)
          Retrieves the value of the designated JDBC ARRAY parameter as an Array sample code for java.sql.Array definition code for java.sql.Array object in the Java programming language.
 Array sample code for java.sql.Array definition code for java.sql.Array getArray sample code for java.sql.CallableStatement.getArray(java.lang.String) definition code for java.sql.CallableStatement.getArray(java.lang.String) (String sample code for java.lang.String definition code for java.lang.String  parameterName)
          Retrieves the value of a JDBC ARRAY parameter as an Array sample code for java.sql.Array definition code for java.sql.Array object in the Java programming language.
 BigDecimal sample code for java.math.BigDecimal definition code for java.math.BigDecimal getBigDecimal sample code for java.sql.CallableStatement.getBigDecimal(int) definition code for java.sql.CallableStatement.getBigDecimal(int) (int parameterIndex)
          Retrieves the value of the designated JDBC NUMERIC parameter as a java.math.BigDecimal object with as many digits to the right of the decimal point as the value contains.
 BigDecimal sample code for java.math.BigDecimal definition code for java.math.BigDecimal getBigDecimal sample code for java.sql.CallableStatement.getBigDecimal(int, int) definition code for java.sql.CallableStatement.getBigDecimal(int, int) (int parameterIndex, int scale)
          Deprecated. use getBigDecimal(int parameterIndex) or getBigDecimal(String parameterName)
 BigDecimal sample code for java.math.BigDecimal definition code for java.math.BigDecimal getBigDecimal sample code for java.sql.CallableStatement.getBigDecimal(java.lang.String) definition code for java.sql.CallableStatement.getBigDecimal(java.lang.String) (String sample code for java.lang.String definition code for java.lang.String  parameterName)
          Retrieves the value of a JDBC NUMERIC parameter as a java.math.BigDecimal object with as many digits to the right of the decimal point as the value contains.
 Blob sample code for java.sql.Blob definition code for java.sql.Blob getBlob sample code for java.sql.CallableStatement.getBlob(int) definition code for java.sql.CallableStatement.getBlob(int) (int i)
          Retrieves the value of the designated JDBC BLOB parameter as a Blob sample code for java.sql.Blob definition code for java.sql.Blob object in the Java programming language.
 Blob sample code for java.sql.Blob definition code for java.sql.Blob getBlob sample code for java.sql.CallableStatement.getBlob(java.lang.String) definition code for java.sql.CallableStatement.getBlob(java.lang.String) (String sample code for java.lang.String definition code for java.lang.String  parameterName)
          Retrieves the value of a JDBC BLOB parameter as a Blob sample code for java.sql.Blob definition code for java.sql.Blob object in the Java programming language.
 boolean getBoolean sample code for java.sql.CallableStatement.getBoolean(int) definition code for java.sql.CallableStatement.getBoolean(int) (int parameterIndex)
          Retrieves the value of the designated JDBC BIT parameter as a boolean in the Java programming language.
 boolean getBoolean sample code for java.sql.CallableStatement.getBoolean(java.lang.String) definition code for java.sql.CallableStatement.getBoolean(java.lang.String) (String sample code for java.lang.String definition code for java.lang.String  parameterName)
          Retrieves the value of a JDBC BIT parameter as a boolean in the Java programming language.
 byte getByte sample code for java.sql.CallableStatement.getByte(int) definition code for java.sql.CallableStatement.getByte(int) (int parameterIndex)
          Retrieves the value of the designated JDBC TINYINT parameter as a byte in the Java programming language.
 byte getByte sample code for java.sql.CallableStatement.getByte(java.lang.String) definition code for java.sql.CallableStatement.getByte(java.lang.String) (String sample code for java.lang.String definition code for java.lang.String  parameterName)
          Retrieves the value of a JDBC TINYINT parameter as a byte in the Java programming language.
 byte[] getBytes sample code for java.sql.CallableStatement.getBytes(int) definition code for java.sql.CallableStatement.getBytes(int) (int parameterIndex)
          Retrieves the value of the designated JDBC BINARY or VARBINARY parameter as an array of byte values in the Java programming language.
 byte[] getBytes sample code for java.sql.CallableStatement.getBytes(java.lang.String) definition code for java.sql.CallableStatement.getBytes(java.lang.String) (String sample code for java.lang.String definition code for java.lang.String  parameterName)
          Retrieves the value of a JDBC BINARY or VARBINARY parameter as an array of byte values in the Java programming language.
 Clob sample code for java.sql.Clob definition code for java.sql.Clob getClob sample code for java.sql.CallableStatement.getClob(int) definition code for java.sql.CallableStatement.getClob(int) (int i)
          Retrieves the value of the designated JDBC CLOB parameter as a Clob object in the Java programming language.
 Clob sample code for java.sql.Clob definition code for java.sql.Clob getClob sample code for java.sql.CallableStatement.getClob(java.lang.String) definition code for java.sql.CallableStatement.getClob(java.lang.String) (String sample code for java.lang.String definition code for java.lang.String  parameterName)
          Retrieves the value of a JDBC CLOB parameter as a Clob object in the Java programming language.
 Date sample code for java.sql.Date definition code for java.sql.Date getDate sample code for java.sql.CallableStatement.getDate(int) definition code for java.sql.CallableStatement.getDate(int) (int parameterIndex)
          Retrieves the value of the designated JDBC DATE parameter as a java.sql.Date object.
 Date sample code for java.sql.Date definition code for java.sql.Date getDate sample code for java.sql.CallableStatement.getDate(int, java.util.Calendar) definition code for java.sql.CallableStatement.getDate(int, java.util.Calendar) (int parameterIndex, Calendar sample code for java.util.Calendar definition code for java.util.Calendar  cal)
          Retrieves the value of the designated JDBC DATE parameter as a java.sql.Date object, using the given Calendar object to construct the date.
 Date sample code for java.sql.Date definition code for java.sql.Date getDate sample code for java.sql.CallableStatement.getDate(java.lang.String) definition code for java.sql.CallableStatement.getDate(java.lang.String) (String sample code for java.lang.String definition code for java.lang.String  parameterName)
          Retrieves the value of a JDBC DATE parameter as a java.sql.Date object.
 Date sample code for java.sql.Date definition code for java.sql.Date getDate sample code for java.sql.CallableStatement.getDate(java.lang.String, java.util.Calendar) definition code for java.sql.CallableStatement.getDate(java.lang.String, java.util.Calendar) (String sample code for java.lang.String definition code for java.lang.String  parameterName, Calendar sample code for java.util.Calendar definition code for java.util.Calendar  cal)
          Retrieves the value of a JDBC DATE parameter as a java.sql.Date object, using the given Calendar object to construct the date.
 double getDouble sample code for java.sql.CallableStatement.getDouble(int) definition code for java.sql.CallableStatement.getDouble(int) (int parameterIndex)
          Retrieves the value of the designated JDBC DOUBLE parameter as a double in the Java programming language.
 double getDouble sample code for java.sql.CallableStatement.getDouble(java.lang.String) definition code for java.sql.CallableStatement.getDouble(java.lang.String) (String sample code for java.lang.String definition code for java.lang.String  parameterName)
          Retrieves the value of a JDBC DOUBLE parameter as a double in the Java programming language.
 float getFloat sample code for java.sql.CallableStatement.getFloat(int) definition code for java.sql.CallableStatement.getFloat(int) (int parameterIndex)
          Retrieves the value of the designated JDBC FLOAT parameter as a float in the Java programming language.
 float getFloat sample code for java.sql.CallableStatement.getFloat(java.lang.String) definition code for java.sql.CallableStatement.getFloat(java.lang.String) (String sample code for java.lang.String definition code for java.lang.String  parameterName)
          Retrieves the value of a JDBC FLOAT parameter as a float in the Java programming language.
 int getInt sample code for java.sql.CallableStatement.getInt(int) definition code for java.sql.CallableStatement.getInt(int) (int parameterIndex)
          Retrieves the value of the designated JDBC INTEGER parameter as an int in the Java programming language.
 int getInt sample code for java.sql.CallableStatement.getInt(java.lang.String) definition code for java.sql.CallableStatement.getInt(java.lang.String) (String sample code for java.lang.String definition code for java.lang.String  parameterName)
          Retrieves the value of a JDBC INTEGER parameter as an int in the Java programming language.
 long getLong sample code for java.sql.CallableStatement.getLong(int) definition code for java.sql.CallableStatement.getLong(int) (int parameterIndex)
          Retrieves the value of the designated JDBC BIGINT parameter as a long in the Java programming language.
 long getLong sample code for java.sql.CallableStatement.getLong(java.lang.String) definition code for java.sql.CallableStatement.getLong(java.lang.String) (String sample code for java.lang.String definition code for java.lang.String  parameterName)
          Retrieves the value of a JDBC BIGINT parameter as a long in the Java programming language.
 Object sample code for java.lang.Object definition code for java.lang.Object getObject sample code for java.sql.CallableStatement.getObject(int) definition code for java.sql.CallableStatement.getObject(int) (int parameterIndex)
          Retrieves the value of the designated parameter as an Object in the Java programming language.
 Object sample code for java.lang.Object definition code for java.lang.Object getObject sample code for java.sql.CallableStatement.getObject(int, java.util.Map) definition code for java.sql.CallableStatement.getObject(int, java.util.Map) (int i, Map sample code for java.util.Map definition code for java.util.Map <String sample code for java.lang.String definition code for java.lang.String ,Class sample code for java.lang.Class definition code for java.lang.Class <?>> map)
          Returns an object representing the value of OUT parameter i and uses map for the custom mapping of the parameter value.
 Object sample code for java.lang.Object definition code for java.lang.Object getObject sample code for java.sql.CallableStatement.getObject(java.lang.String) definition code for java.sql.CallableStatement.getObject(java.lang.String) (String sample code for java.lang.String definition code for java.lang.String  parameterName)
          Retrieves the value of a parameter as an Object in the Java programming language.
 Object sample code for java.lang.Object definition code for java.lang.Object getObject sample code for java.sql.CallableStatement.getObject(java.lang.String, java.util.Map) definition code for java.sql.CallableStatement.getObject(java.lang.String, java.util.Map) (String sample code for java.lang.String definition code for java.lang.String  parameterName, Map sample code for java.util.Map definition code for java.util.Map <String sample code for java.lang.String definition code for java.lang.String ,Class sample code for java.lang.Class definition code for java.lang.Class <?>> map)
          Returns an object representing the value of OUT parameter i and uses map for the custom mapping of the parameter value.
 Ref sample code for java.sql.Ref definition code for java.sql.Ref getRef sample code for java.sql.CallableStatement.getRef(int) definition code for java.sql.CallableStatement.getRef(int) (int i)
          Retrieves the value of the designated JDBC REF(<structured-type>) parameter as a Ref sample code for java.sql.Ref definition code for java.sql.Ref object in the Java programming language.
 Ref sample code for java.sql.Ref definition code for java.sql.Ref getRef sample code for java.sql.CallableStatement.getRef(java.lang.String) definition code for java.sql.CallableStatement.getRef(java.lang.String) (String sample code for java.lang.String definition code for java.lang.String  parameterName)
          Retrieves the value of a JDBC REF(<structured-type>) parameter as a Ref sample code for java.sql.Ref definition code for java.sql.Ref object in the Java programming language.
 short getShort sample code for java.sql.CallableStatement.getShort(int) definition code for java.sql.CallableStatement.getShort(int) (int parameterIndex)
          Retrieves the value of the designated JDBC SMALLINT parameter as a short in the Java programming language.
 short getShort sample code for java.sql.CallableStatement.getShort(java.lang.String) definition code for java.sql.CallableStatement.getShort(java.lang.String) (String sample code for java.lang.String definition code for java.lang.String  parameterName)
          Retrieves the value of a JDBC SMALLINT parameter as a short in the Java programming language.
 String sample code for java.lang.String definition code for java.lang.String getString sample code for java.sql.CallableStatement.getString(int) definition code for java.sql.CallableStatement.getString(int) (int parameterIndex)
          Retrieves the value of the designated JDBC CHAR, VARCHAR, or LONGVARCHAR parameter as a String in the Java programming language.
 String sample code for java.lang.String definition code for java.lang.String getString sample code for java.sql.CallableStatement.getString(java.lang.String) definition code for java.sql.CallableStatement.getString(java.lang.String) (String sample code for java.lang.String definition code for java.lang.String  parameterName)
          Retrieves the value of a JDBC CHAR, VARCHAR, or LONGVARCHAR parameter as a String in the Java programming language.
 Time sample code for java.sql.Time definition code for java.sql.Time getTime sample code for java.sql.CallableStatement.getTime(int) definition code for java.sql.CallableStatement.getTime(int) (int parameterIndex)
          Retrieves the value of the designated JDBC TIME parameter as a java.sql.Time object.
 Time sample code for java.sql.Time definition code for java.sql.Time getTime sample code for java.sql.CallableStatement.getTime(int, java.util.Calendar) definition code for java.sql.CallableStatement.getTime(int, java.util.Calendar) (int parameterIndex, Calendar sample code for java.util.Calendar definition code for java.util.Calendar  cal)
          Retrieves the value of the designated JDBC TIME parameter as a java.sql.Time object, using the given Calendar object to construct the time.
 Time sample code for java.sql.Time definition code for java.sql.Time getTime sample code for java.sql.CallableStatement.getTime(java.lang.String) definition code for java.sql.CallableStatement.getTime(java.lang.String) (String sample code for java.lang.String definition code for java.lang.String  parameterName)
          Retrieves the value of a JDBC TIME parameter as a java.sql.Time object.
 Time sample code for java.sql.Time definition code for java.sql.Time getTime sample code for java.sql.CallableStatement.getTime(java.lang.String, java.util.Calendar) definition code for java.sql.CallableStatement.getTime(java.lang.String, java.util.Calendar) (String sample code for java.lang.String definition code for java.lang.String  parameterName, Calendar sample code for java.util.Calendar definition code for java.util.Calendar  cal)
          Retrieves the value of a JDBC TIME parameter as a java.sql.Time object, using the given Calendar object to construct the time.
 Timestamp sample code for java.sql.Timestamp definition code for java.sql.Timestamp getTimestamp sample code for java.sql.CallableStatement.getTimestamp(int) definition code for java.sql.CallableStatement.getTimestamp(int) (int parameterIndex)
          Retrieves the value of the designated JDBC TIMESTAMP parameter as a java.sql.Timestamp object.
 Timestamp sample code for java.sql.Timestamp definition code for java.sql.Timestamp getTimestamp sample code for java.sql.CallableStatement.getTimestamp(int, java.util.Calendar) definition code for java.sql.CallableStatement.getTimestamp(int, java.util.Calendar) (int parameterIndex, Calendar sample code for java.util.Calendar definition code for java.util.Calendar  cal)
          Retrieves the value of the designated JDBC TIMESTAMP parameter as a java.sql.Timestamp object, using the given Calendar object to construct the Timestamp object.
 Timestamp sample code for java.sql.Timestamp definition code for java.sql.Timestamp getTimestamp sample code for java.sql.CallableStatement.getTimestamp(java.lang.String) definition code for java.sql.CallableStatement.getTimestamp(java.lang.String) (String sample code for java.lang.String definition code for java.lang.String  parameterName)
          Retrieves the value of a JDBC TIMESTAMP parameter as a java.sql.Timestamp object.
 Timestamp sample code for java.sql.Timestamp definition code for java.sql.Timestamp getTimestamp sample code for java.sql.CallableStatement.getTimestamp(java.lang.String, java.util.Calendar) definition code for java.sql.CallableStatement.getTimestamp(java.lang.String, java.util.Calendar) (String sample code for java.lang.String definition code for java.lang.String  parameterName, Calendar sample code for java.util.Calendar definition code for java.util.Calendar  cal)
          Retrieves the value of a JDBC TIMESTAMP parameter as a java.sql.Timestamp object, using the given Calendar object to construct the Timestamp object.
 URL sample code for java.net.URL definition code for java.net.URL getURL sample code for java.sql.CallableStatement.getURL(int) definition code for java.sql.CallableStatement.getURL(int) (int parameterIndex)
          Retrieves the value of the designated JDBC DATALINK parameter as a java.net.URL object.
 URL sample code for java.net.URL definition code for java.net.URL getURL sample code for java.sql.CallableStatement.getURL(java.lang.String) definition code for java.sql.CallableStatement.getURL(java.lang.String) (String sample code for java.lang.String definition code for java.lang.String  parameterName)
          Retrieves the value of a JDBC DATALINK parameter as a java.net.URL object.
 void registerOutParameter sample code for java.sql.CallableStatement.registerOutParameter(int, int) definition code for java.sql.CallableStatement.registerOutParameter(int, int) (int parameterIndex, int sqlType)
          Registers the OUT parameter in ordinal position parameterIndex to the JDBC type sqlType.
 void registerOutParameter sample code for java.sql.CallableStatement.registerOutParameter(int, int, int) definition code for java.sql.CallableStatement.registerOutParameter(int, int, int) (int parameterIndex, int sqlType, int scale)
          Registers the parameter in ordinal position parameterIndex to be of JDBC type sqlType.
 void registerOutParameter sample code for java.sql.CallableStatement.registerOutParameter(int, int, java.lang.String) definition code for java.sql.CallableStatement.registerOutParameter(int, int, java.lang.String) (int paramIndex, int sqlType, String sample code for java.lang.String definition code for java.lang.String  typeName)
          Registers the designated output parameter.
 void registerOutParameter sample code for java.sql.CallableStatement.registerOutParameter(java.lang.String, int) definition code for java.sql.CallableStatement.registerOutParameter(java.lang.String, int) (String sample code for java.lang.String definition code for java.lang.String  parameterName, int sqlType)
          Registers the OUT parameter named parameterName to the JDBC type sqlType.
 void registerOutParameter sample code for java.sql.CallableStatement.registerOutParameter(java.lang.String, int, int) definition code for java.sql.CallableStatement.registerOutParameter(java.lang.String, int, int) (String sample code for java.lang.String definition code for java.lang.String  parameterName, int sqlType, int scale)
          Registers the parameter named parameterName to be of JDBC type sqlType.
 void registerOutParameter sample code for java.sql.CallableStatement.registerOutParameter(java.lang.String, int, java.lang.String) definition code for java.sql.CallableStatement.registerOutParameter(java.lang.String, int, java.lang.String) (String sample code for java.lang.String definition code for java.lang.String  parameterName, int sqlType, String sample code for java.lang.String definition code for java.lang.String  typeName)
          Registers the designated output parameter.
 void setAsciiStream sample code for java.sql.CallableStatement.setAsciiStream(java.lang.String, java.io.InputStream, int) definition code for java.sql.CallableStatement.setAsciiStream(java.lang.String, java.io.InputStream, int) (String sample code for java.lang.String definition code for java.lang.String  parameterName, InputStream sample code for java.io.InputStream definition code for java.io.InputStream  x, int length)
          Sets the designated parameter to the given input stream, which will have the specified number of bytes.
 void setBigDecimal sample code for java.sql.CallableStatement.setBigDecimal(java.lang.String, java.math.BigDecimal) definition code for java.sql.CallableStatement.setBigDecimal(java.lang.String, java.math.BigDecimal) (String sample code for java.lang.String definition code for java.lang.String  parameterName, BigDecimal sample code for java.math.BigDecimal definition code for java.math.BigDecimal  x)
          Sets the designated parameter to the given java.math.BigDecimal value.
 void setBinaryStream sample code for java.sql.CallableStatement.setBinaryStream(java.lang.String, java.io.InputStream, int) definition code for java.sql.CallableStatement.setBinaryStream(java.lang.String, java.io.InputStream, int) (String sample code for java.lang.String definition code for java.lang.String  parameterName, InputStream sample code for java.io.InputStream definition code for java.io.InputStream  x, int length)
          Sets the designated parameter to the given input stream, which will have the specified number of bytes.
 void setBoolean sample code for java.sql.CallableStatement.setBoolean(java.lang.String, boolean) definition code for java.sql.CallableStatement.setBoolean(java.lang.String, boolean) (String sample code for java.lang.String definition code for java.lang.String  parameterName, boolean x)
          Sets the designated parameter to the given Java boolean value.
 void setByte sample code for java.sql.CallableStatement.setByte(java.lang.String, byte) definition code for java.sql.CallableStatement.setByte(java.lang.String, byte) (String sample code for java.lang.String definition code for java.lang.String  parameterName, byte x)
          Sets the designated parameter to the given Java byte value.
 void setBytes sample code for java.sql.CallableStatement.setBytes(java.lang.String, byte[]) definition code for java.sql.CallableStatement.setBytes(java.lang.String, byte[]) (String sample code for java.lang.String definition code for java.lang.String  parameterName, byte[] x)
          Sets the designated parameter to the given Java array of bytes.
 void setCharacterStream sample code for java.sql.CallableStatement.setCharacterStream(java.lang.String, java.io.Reader, int) definition code for java.sql.CallableStatement.setCharacterStream(java.lang.String, java.io.Reader, int) (String