Name
CallableStatement
Synopsis
The CallableStatement
interface allows programs to access SQL stored procedures within the database. You create a CallableStatement
with the prepareCall()
method of Connection
. Question mark characters (?) are used as placeholders for input and output values in the syntax used to call stored procedures:
{? = callprocedure_name
[(?[,?...])]}{callprocedure_name
[(?[,?...])]}
Parameters are numbered sequentially starting from 1. Input parameters are set with the same setXXX()
methods as in a PreparedStatement
. Output parameters must be registered using the registerOutParameter()
methods, and may be retrieved after the statement executes using the getXXX()
methods, which are identical to those in ResultSet
. To execute a statement, you call execute()
, which is inherited from PreparedStatement
.
public interface CallableStatement extends PreparedStatement { // Public Instance Methods public abstract java.sql.Array getArray( // 1.2 int i) throws SQLException; public abstract java.sql.Array getArray( // 1.4 String parameterName) throws SQLException; public abstract java.math.BigDecimal getBigDecimal( // 1.2 int parameterIndex) throws SQLException; public abstract java.math.BigDecimal getBigDecimal( // 1.4 String parameterName) throws SQLException; public abstract Blob getBlob( // 1.4 String parameterName) throws SQLException; public abstract Blob getBlob( int ...
Get Java Enterprise in a Nutshell, Second Edition now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.