| java.lang.Object com.internetcds.jdbc.tds.Statement com.internetcds.jdbc.tds.PreparedStatement_base com.internetcds.jdbc.tds.CallableStatement_base
All known Subclasses: com.internetcds.jdbc.tds.CallableStatement_2_0,
CallableStatement_base | public class CallableStatement_base extends com.internetcds.jdbc.tds.PreparedStatement_base (Code) | | CallableStatement is used to execute SQL stored procedures.
JDBC provides a stored procedure SQL escape that allows stored
procedures to be called in a standard way for all RDBMS's. 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 may be used for input,
output or both. Parameters are refered to sequentially, by
number. The first parameter is 1.
{?= call [,, ...]}
{call [,, ...]}
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.
A Callable statement may return a ResultSet or multiple
ResultSets. Multiple ResultSets are handled using operations
inherited from Statement.
For maximum portability, a call's ResultSets and update counts
should be processed prior to getting the values of output
parameters.
See Also: Connection.prepareCall See Also: ResultSet |
Method Summary | |
public boolean | execute() | public BigDecimal | getBigDecimal(int parameterIndex, int scale) Get the value of a NUMERIC parameter as a java.math.BigDecimal object. | public BigDecimal | getBigDecimal(int parameterIndex) JDBC 2.0
Gets 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.
Parameters: parameterIndex - the first parameter is 1, the second is 2,and so on the parameter value in full precision. | public boolean | getBoolean(int parameterIndex) Get the value of a BIT parameter as a Java boolean.
Parameters: parameterIndex - the first parameter is 1, the second is 2, ... | public byte | getByte(int parameterIndex) Get the value of a TINYINT parameter as a Java byte.
Parameters: parameterIndex - the first parameter is 1, the second is 2, ... | public byte[] | getBytes(int parameterIndex) Get the value of a SQL BINARY or VARBINARY parameter as a Java byte[]
Parameters: parameterIndex - the first parameter is 1, the second is 2, ... | public java.sql.Date | getDate(int parameterIndex) Get the value of a SQL DATE parameter as a java.sql.Date object
Parameters: parameterIndex - the first parameter is 1, the second is 2, ... | public java.sql.Date | getDate(int parameterIndex, Calendar cal) Gets the value of a JDBC DATE parameter as a
java.sql.Date object, using
the given Calendar object
to construct the date.
With a Calendar object, the driver
can calculate the date taking into account a custom timezone and locale.
If no Calendar object is specified, the driver uses the
default timezone and locale.
Parameters: parameterIndex - the first parameter is 1, the second is 2, and so on Parameters: cal - the Calendar object the driver will useto construct the date the parameter value. | public double | getDouble(int parameterIndex) Get the value of a DOUBLE parameter as a Java double.
Parameters: parameterIndex - the first parameter is 1, the second is 2, ... | public float | getFloat(int parameterIndex) Get the value of a FLOAT parameter as a Java float.
Parameters: parameterIndex - the first parameter is 1, the second is 2, ... | public int | getInt(int parameterIndex) Get the value of an INTEGER parameter as a Java int.
Parameters: parameterIndex - the first parameter is 1, the second is 2, ... | public long | getLong(int parameterIndex) Get the value of a BIGINT parameter as a Java long.
Parameters: parameterIndex - the first parameter is 1, the second is 2, ... | public Object | getObject(int parameterIndex) Get the value of a parameter as a Java object.
This method returns a Java object whose type coresponds to the SQL
type that was registered for this parameter using registerOutParameter.
Note that this method may be used to read
datatabase-specific, abstract data types. | public short | getShort(int parameterIndex) Get the value of a SMALLINT parameter as a Java short.
Parameters: parameterIndex - the first parameter is 1, the second is 2, ... | public String | getString(int parameterIndex) Get the value of a CHAR, VARCHAR, or LONGVARCHAR parameter as a Java String.
Parameters: parameterIndex - the first parameter is 1, the second is 2, ... | public java.sql.Time | getTime(int parameterIndex) Get the value of a SQL TIME parameter as a java.sql.Time object.
Parameters: parameterIndex - the first parameter is 1, the second is 2, ... | public java.sql.Time | getTime(int parameterIndex, Calendar cal) Gets the value of a JDBC TIME parameter as a
java.sql.Time object, using
the given Calendar object
to construct the time. | public java.sql.Timestamp | getTimestamp(int parameterIndex) Get the value of a SQL TIMESTAMP parameter as a java.sql.Timestamp object.
Parameters: parameterIndex - the first parameter is 1, the second is 2, ... | public java.sql.Timestamp | getTimestamp(int parameterIndex, Calendar cal) Gets the value of a JDBC TIMESTAMP parameter as a
java.sql.Timestamp object, using
the given Calendar object to construct
the Timestamp object.
With a Calendar object, the driver
can calculate the timestamp taking into account a custom timezone and locale.
If no Calendar object is specified, the driver uses the
default timezone and locale.
Parameters: parameterIndex - the first parameter is 1, the second is 2, and so on Parameters: cal - the Calendar object the driver will useto construct the timestamp the parameter value. | public static void | main(String args) | public void | registerOutParameter(int parameterIndex, int sqlType) Before executing a stored procedure call, you must explicitly
call registerOutParameter to register the java.sql.Type of each
out parameter. | public void | registerOutParameter(int parameterIndex, int sqlType, int scale) Use this version of registerOutParameter for registering
Numeric or Decimal out parameters. | public void | registerOutParameter(int paramIndex, int sqlType, String typeName) JDBC 2.0
Registers the designated output parameter. | public boolean | wasNull() An OUT parameter may have the value of SQL NULL; wasNull reports
whether the last value read has this special value. |
getBigDecimal | public BigDecimal getBigDecimal(int parameterIndex, int scale) throws SQLException(Code) | | Get the value of a NUMERIC parameter as a java.math.BigDecimal object.
Parameters: parameterIndex - the first parameter is 1, the second is 2, ... Parameters: scale - a value greater than or equal to zero representing thedesired number of digits to the right of the decimal point the parameter value; if the value is SQL NULL, the result isnull exception: SQLException - if a database-access error occurs. |
getBigDecimal | public BigDecimal getBigDecimal(int parameterIndex) throws SQLException(Code) | | JDBC 2.0
Gets 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.
Parameters: parameterIndex - the first parameter is 1, the second is 2,and so on the parameter value in full precision. If the value is SQL NULL, the result is null . exception: SQLException - if a database access error occurs |
getBoolean | public boolean getBoolean(int parameterIndex) throws SQLException(Code) | | Get the value of a BIT parameter as a Java boolean.
Parameters: parameterIndex - the first parameter is 1, the second is 2, ... the parameter value; if the value is SQL NULL, the result is false exception: SQLException - if a database-access error occurs. |
getByte | public byte getByte(int parameterIndex) throws SQLException(Code) | | Get the value of a TINYINT parameter as a Java byte.
Parameters: parameterIndex - the first parameter is 1, the second is 2, ... the parameter value; if the value is SQL NULL, the result is 0 exception: SQLException - if a database-access error occurs. |
getBytes | public byte[] getBytes(int parameterIndex) throws SQLException(Code) | | Get the value of a SQL BINARY or VARBINARY parameter as a Java byte[]
Parameters: parameterIndex - the first parameter is 1, the second is 2, ... the parameter value; if the value is SQL NULL, the result is null exception: SQLException - if a database-access error occurs. |
getDate | public java.sql.Date getDate(int parameterIndex) throws SQLException(Code) | | Get the value of a SQL DATE parameter as a java.sql.Date object
Parameters: parameterIndex - the first parameter is 1, the second is 2, ... the parameter value; if the value is SQL NULL, the result is null exception: SQLException - if a database-access error occurs. |
getDate | public java.sql.Date getDate(int parameterIndex, Calendar cal) throws SQLException(Code) | | Gets the value of a JDBC DATE parameter as a
java.sql.Date object, using
the given Calendar object
to construct the date.
With a Calendar object, the driver
can calculate the date taking into account a custom timezone and locale.
If no Calendar object is specified, the driver uses the
default timezone and locale.
Parameters: parameterIndex - the first parameter is 1, the second is 2, and so on Parameters: cal - the Calendar object the driver will useto construct the date the parameter value. If the value is SQL NULL, the result is null . exception: SQLException - if a database access error occurs |
getDouble | public double getDouble(int parameterIndex) throws SQLException(Code) | | Get the value of a DOUBLE parameter as a Java double.
Parameters: parameterIndex - the first parameter is 1, the second is 2, ... the parameter value; if the value is SQL NULL, the result is 0 exception: SQLException - if a database-access error occurs. |
getFloat | public float getFloat(int parameterIndex) throws SQLException(Code) | | Get the value of a FLOAT parameter as a Java float.
Parameters: parameterIndex - the first parameter is 1, the second is 2, ... the parameter value; if the value is SQL NULL, the result is 0 exception: SQLException - if a database-access error occurs. |
getInt | public int getInt(int parameterIndex) throws SQLException(Code) | | Get the value of an INTEGER parameter as a Java int.
Parameters: parameterIndex - the first parameter is 1, the second is 2, ... the parameter value; if the value is SQL NULL, the result is 0 exception: SQLException - if a database-access error occurs. |
getLong | public long getLong(int parameterIndex) throws SQLException(Code) | | Get the value of a BIGINT parameter as a Java long.
Parameters: parameterIndex - the first parameter is 1, the second is 2, ... the parameter value; if the value is SQL NULL, the result is 0 exception: SQLException - if a database-access error occurs. |
getObject | public Object getObject(int parameterIndex) throws SQLException(Code) | | Get the value of a parameter as a Java object.
This method returns a Java object whose type coresponds to the SQL
type that was registered for this parameter using registerOutParameter.
Note that this method may be used to read
datatabase-specific, abstract data types. This is done by
specifying a targetSqlType of java.sql.types.OTHER, which
allows the driver to return a database-specific Java type.
Parameters: parameterIndex - The first parameter is 1, the second is 2, ... A java.lang.Object holding the OUT parameter value. exception: SQLException - if a database-access error occurs. See Also: Types |
getShort | public short getShort(int parameterIndex) throws SQLException(Code) | | Get the value of a SMALLINT parameter as a Java short.
Parameters: parameterIndex - the first parameter is 1, the second is 2, ... the parameter value; if the value is SQL NULL, the result is 0 exception: SQLException - if a database-access error occurs. |
getString | public String getString(int parameterIndex) throws SQLException(Code) | | Get the value of a CHAR, VARCHAR, or LONGVARCHAR parameter as a Java String.
Parameters: parameterIndex - the first parameter is 1, the second is 2, ... the parameter value; if the value is SQL NULL, the result is null exception: SQLException - if a database-access error occurs. |
getTime | public java.sql.Time getTime(int parameterIndex) throws SQLException(Code) | | Get the value of a SQL TIME parameter as a java.sql.Time object.
Parameters: parameterIndex - the first parameter is 1, the second is 2, ... the parameter value; if the value is SQL NULL, the result is null exception: SQLException - if a database-access error occurs. |
getTime | public java.sql.Time getTime(int parameterIndex, Calendar cal) throws SQLException(Code) | | Gets the value of a JDBC TIME parameter as a
java.sql.Time object, using
the given Calendar object
to construct the time.
With a Calendar object, the driver
can calculate the time taking into account a custom timezone and locale.
If no Calendar object is specified, the driver uses the
default timezone and locale.
Parameters: parameterIndex - the first parameter is 1, the second is 2,and so on Parameters: cal - the Calendar object the driver will useto construct the time the parameter value; if the value is SQL NULL, the result is null . exception: SQLException - if a database access error occurs |
getTimestamp | public java.sql.Timestamp getTimestamp(int parameterIndex) throws SQLException(Code) | | Get the value of a SQL TIMESTAMP parameter as a java.sql.Timestamp object.
Parameters: parameterIndex - the first parameter is 1, the second is 2, ... the parameter value; if the value is SQL NULL, the result is null exception: SQLException - if a database-access error occurs. |
getTimestamp | public java.sql.Timestamp getTimestamp(int parameterIndex, Calendar cal) throws SQLException(Code) | | Gets the value of a JDBC TIMESTAMP parameter as a
java.sql.Timestamp object, using
the given Calendar object to construct
the Timestamp object.
With a Calendar object, the driver
can calculate the timestamp taking into account a custom timezone and locale.
If no Calendar object is specified, the driver uses the
default timezone and locale.
Parameters: parameterIndex - the first parameter is 1, the second is 2, and so on Parameters: cal - the Calendar object the driver will useto construct the timestamp the parameter value. If the value is SQL NULL, the result is null . exception: SQLException - if a database access error occurs |
registerOutParameter | public void registerOutParameter(int parameterIndex, int sqlType) throws SQLException(Code) | | Before executing a stored procedure call, you must explicitly
call registerOutParameter to register the java.sql.Type of each
out parameter.
Note: When reading the value of an out parameter, you
must use the getXXX method whose Java type XXX corresponds to the
parameter's registered SQL type.
Parameters: parameterIndex - the first parameter is 1, the second is 2,... Parameters: sqlType - SQL type code defined by java.sql.Types;for parameters of type Numeric or Decimal use the version ofregisterOutParameter that accepts a scale value exception: SQLException - if a database-access error occurs. See Also: Type |
registerOutParameter | public void registerOutParameter(int parameterIndex, int sqlType, int scale) throws SQLException(Code) | | Use this version of registerOutParameter for registering
Numeric or Decimal out parameters.
Note: When reading the value of an out parameter, you
must use the getXXX method whose Java type XXX corresponds to the
parameter's registered SQL type.
Parameters: parameterIndex - the first parameter is 1, the second is 2, ... Parameters: sqlType - use either java.sql.Type.NUMERIC or java.sql.Type.DECIMAL Parameters: scale - a value greater than or equal to zero representing thedesired number of digits to the right of the decimal point exception: SQLException - if a database-access error occurs. See Also: Type |
registerOutParameter | public void registerOutParameter(int paramIndex, int sqlType, String typeName) throws SQLException(Code) | | JDBC 2.0
Registers the designated output parameter. This version of
the method registerOutParameter
should be used for a user-named or REF output parameter. Examples
of user-named types include: STRUCT, DISTINCT, JAVA_OBJECT, and
named array types.
Before executing a stored procedure call, you must explicitly
call registerOutParameter to register the type from
java.sql.Types for each
OUT parameter. For a user-named parameter the fully-qualified SQL
type name of the parameter should also be given, while a REF
parameter requires that the fully-qualified type name of the
referenced type be given. A JDBC driver that does not need the
type code and type name information may ignore it. To be portable,
however, applications should always provide these values for
user-named and REF parameters.
Although it is intended for user-named and REF parameters,
this method may be used to register a parameter of any JDBC type.
If the parameter does not have a user-named or REF type, the
typeName parameter is ignored.
Note: When reading the value of an out parameter, you
must use the getXXX method whose Java type XXX corresponds to the
parameter's registered SQL type.
Parameters: parameterIndex - the first parameter is 1, the second is 2,... Parameters: sqlType - a value from java.sql.Types Parameters: typeName - the fully-qualified name of an SQL structured type exception: SQLException - if a database-access error occurs See Also: Types |
wasNull | public boolean wasNull() throws SQLException(Code) | | An OUT parameter may have the value of SQL NULL; wasNull reports
whether the last value read has this special value.
Note: You must first call getXXX on a parameter to
read its value and then call wasNull() to see if the value was
SQL NULL.
true if the last parameter read was SQL NULL exception: SQLException - if a database-access error occurs. |
Methods inherited from com.internetcds.jdbc.tds.PreparedStatement_base | protected void NotImplemented() throws java.sql.SQLException(Code)(Java Doc) public void clearParameters() throws SQLException(Code)(Java Doc) public void dropAllProcedures()(Code)(Java Doc) public boolean execute() throws SQLException(Code)(Java Doc) protected boolean executeCall(String name, ParameterListItem[] formalParameterList, ParameterListItem[] actualParameterList) throws SQLException(Code)(Java Doc) public java.sql.ResultSet executeQuery() throws SQLException(Code)(Java Doc) public int executeUpdate() throws SQLException(Code)(Java Doc) public static void main(String args) throws java.lang.ClassNotFoundException, java.lang.IllegalAccessException, java.lang.InstantiationException, SQLException(Code)(Java Doc) public void setAsciiStream(int parameterIndex, java.io.InputStream x, int length) throws SQLException(Code)(Java Doc) public void setBigDecimal(int parameterIndex, BigDecimal x) throws SQLException(Code)(Java Doc) public void setBinaryStream(int parameterIndex, java.io.InputStream x, int length) throws SQLException(Code)(Java Doc) public void setBoolean(int parameterIndex, boolean x) throws SQLException(Code)(Java Doc) public void setByte(int index, byte x) throws SQLException(Code)(Java Doc) public void setBytes(int parameterIndex, byte x) throws SQLException(Code)(Java Doc) public void setDate(int parameterIndex, java.sql.Date value) throws SQLException(Code)(Java Doc) public void setDouble(int parameterIndex, double value) throws SQLException(Code)(Java Doc) public void setFloat(int parameterIndex, float value) throws SQLException(Code)(Java Doc) public void setInt(int index, int value) throws SQLException(Code)(Java Doc) public void setLong(int parameterIndex, long value) throws SQLException(Code)(Java Doc) public void setNull(int index, int type) throws SQLException(Code)(Java Doc) public void setObject(int parameterIndex, Object x) throws SQLException(Code)(Java Doc) public void setObject(int parameterIndex, Object x, int targetSqlType) throws SQLException(Code)(Java Doc) public void setObject(int parameterIndex, Object x, int targetSqlType, int scale) throws SQLException(Code)(Java Doc) public void setShort(int index, short value) throws SQLException(Code)(Java Doc) public void setString(int index, String str) throws SQLException(Code)(Java Doc) public void setTime(int parameterIndex, java.sql.Time x) throws SQLException(Code)(Java Doc) public void setTimestamp(int index, java.sql.Timestamp value) throws SQLException(Code)(Java Doc) public void setUnicodeStream(int parameterIndex, java.io.InputStream x, int length) throws SQLException(Code)(Java Doc)
|
Methods inherited from com.internetcds.jdbc.tds.Statement | public void addBatch(String sql) throws SQLException(Code)(Java Doc) public void cancel() throws SQLException(Code)(Java Doc) public void clearBatch() throws SQLException(Code)(Java Doc) public void clearWarnings() throws SQLException(Code)(Java Doc) public void close() throws SQLException(Code)(Java Doc) protected void closeResults() throws java.sql.SQLException(Code)(Java Doc) public void commit() throws java.sql.SQLException, java.io.IOException, com.internetcds.jdbc.tds.TdsUnknownPacketSubType, com.internetcds.jdbc.tds.TdsException(Code)(Java Doc) public boolean execute(String sql) throws SQLException(Code)(Java Doc) public boolean execute(String sql, int autoGeneratedKeys) throws SQLException(Code)(Java Doc) public boolean execute(String sql, int[] columnIndexes) throws SQLException(Code)(Java Doc) public boolean execute(String sql, String[] columnNames) throws SQLException(Code)(Java Doc) public int[] executeBatch() throws SQLException(Code)(Java Doc) public java.sql.ResultSet executeQuery(String sql) throws SQLException(Code)(Java Doc) public int executeUpdate(String sql) throws SQLException(Code)(Java Doc) public int executeUpdate(String sql, int autoGeneratedKeys) throws SQLException(Code)(Java Doc) public int executeUpdate(String sql, int[] columnIndexes) throws SQLException(Code)(Java Doc) public int executeUpdate(String sql, String[] columnNames) throws SQLException(Code)(Java Doc) protected void finalize() throws Throwable(Code)(Java Doc) public java.sql.Connection getConnection() throws SQLException(Code)(Java Doc) public int getFetchDirection() throws SQLException(Code)(Java Doc) public int getFetchSize() throws SQLException(Code)(Java Doc) public ResultSet getGeneratedKeys() throws SQLException(Code)(Java Doc) public int getMaxFieldSize() throws SQLException(Code)(Java Doc) public int getMaxRows() throws SQLException(Code)(Java Doc) public boolean getMoreResults() throws SQLException(Code)(Java Doc) public boolean getMoreResults(int current) throws SQLException(Code)(Java Doc) public int getQueryTimeout() throws SQLException(Code)(Java Doc) public java.sql.ResultSet getResultSet() throws SQLException(Code)(Java Doc) public int getResultSetConcurrency() throws SQLException(Code)(Java Doc) public int getResultSetHoldability() throws SQLException(Code)(Java Doc) public int getResultSetType() throws SQLException(Code)(Java Doc) public int getUpdateCount() throws SQLException(Code)(Java Doc) public SQLWarning getWarnings() throws SQLException(Code)(Java Doc) public boolean isClosed()(Code)(Java Doc) public boolean isPoolable() throws SQLException(Code)(Java Doc) public boolean isWrapperFor(Class> iface) throws SQLException(Code)(Java Doc) public static void main(String args) throws java.lang.ClassNotFoundException, java.lang.IllegalAccessException, java.lang.InstantiationException, SQLException(Code)(Java Doc) public void rollback() throws java.sql.SQLException, java.io.IOException, com.internetcds.jdbc.tds.TdsUnknownPacketSubType, com.internetcds.jdbc.tds.TdsException(Code)(Java Doc) public void setCursorName(String name) throws SQLException(Code)(Java Doc) public void setEscapeProcessing(boolean enable) throws SQLException(Code)(Java Doc) public void setFetchDirection(int direction) throws SQLException(Code)(Java Doc) public void setFetchSize(int rows) throws SQLException(Code)(Java Doc) public void setMaxFieldSize(int max) throws SQLException(Code)(Java Doc) public void setMaxRows(int max) throws SQLException(Code)(Java Doc) public void setPoolable(boolean poolable) throws SQLException(Code)(Java Doc) public void setQueryTimeout(int seconds) throws SQLException(Code)(Java Doc) protected void startResultSet() throws SQLException(Code)(Java Doc) public T unwrap(Class<T> iface) throws SQLException(Code)(Java Doc)
|
|
|