Top Description Constructors Methods
org.apache.derby.client.am

public Class LogicalCallableStatement42

extends LogicalCallableStatement
Class Inheritance
Imports
java.sql.CallableStatement, .SQLException, .SQLType, org.apache.derby.client.am.stmtcache.StatementKey

JDBC 4 specific wrapper class for a Derby physical callable statement.
See Also
LogicalCallableStatement, isClosed

Constructor Summary

AccessConstructor and Description
public
LogicalCallableStatement42(CallableStatement
underlying physical statement
physicalCs
,
StatementKey
key for the physical statement
stmtKey
,
StatementCacheInteractor
creating statement cache interactor
cacheInteractor
)

Creates a new logical callable statement.

Method Summary

Modifier and TypeMethod and Description
public void
registerOutParameter(int
the first parameter is 1, the second is 2, and so on
parameterIndex
,
SQLType
the JDBC type code defined by SQLType to use to register the OUT Parameter. If the parameter is of JDBC type JDBCType.NUMERIC or JDBCType.DECIMAL, the version of registerOutParameter that accepts a scale value should be used.
sqlType
)

Overrides default java.sql.CallableStatement.registerOutParameter.

Registers the OUT parameter in ordinal position parameterIndex to the JDBC type sqlType.
public void
registerOutParameter(int
the first parameter is 1, the second is 2, and so on
parameterIndex
,
SQLType
the JDBC type code defined by SQLType to use to register the OUT Parameter.
sqlType
,
int
the desired number of digits to the right of the decimal point. It must be greater than or equal to zero.
scale
)

Overrides default java.sql.CallableStatement.registerOutParameter.

Registers the parameter in ordinal position parameterIndex to be of JDBC type sqlType.
public void
registerOutParameter(int
the first parameter is 1, the second is 2,...
parameterIndex
,
SQLType
the JDBC type code defined by SQLType to use to register the OUT Parameter.
sqlType
,
String
the fully-qualified name of an SQL structured type
typeName
)

Overrides default java.sql.CallableStatement.registerOutParameter.

Registers the designated output parameter.
public void
registerOutParameter(String
the name of the parameter
parameterName
,
SQLType
the JDBC type code defined by SQLType to use to register the OUT Parameter. If the parameter is of JDBC type JDBCType.NUMERIC or JDBCType.DECIMAL, the version of registerOutParameter that accepts a scale value should be used.
sqlType
)

Overrides default java.sql.CallableStatement.registerOutParameter.

Registers the OUT parameter named parameterName to the JDBC type sqlType.
public void
registerOutParameter(String
the name of the parameter
parameterName
,
SQLType
the JDBC type code defined by SQLType to use to register the OUT Parameter.
sqlType
,
int
the desired number of digits to the right of the decimal point. It must be greater than or equal to zero.
scale
)

Overrides default java.sql.CallableStatement.registerOutParameter.

Registers the parameter named parameterName to be of JDBC type sqlType.
public void
registerOutParameter(String
the name of the parameter
parameterName
,
SQLType
the JDBC type code defined by SQLType to use to register the OUT Parameter.
sqlType
,
String
the fully-qualified name of an SQL structured type
typeName
)

Overrides default java.sql.CallableStatement.registerOutParameter.

Registers the designated output parameter.
public void
setObject(int
the first parameter is 1, the second is 2, ...
parameterIndex
,
Object
the object containing the input parameter value
x
,
SQLType
the SQL type to be sent to the database
sqlType
)

Overrides default java.sql.PreparedStatement.setObject.

Sets the value of the designated parameter with the given object.
public void
setObject(int
the first parameter is 1, the second is 2, ...
parameterIndex
,
Object
the object containing the input parameter value
x
,
SQLType
the SQL type to be sent to the database. The scale argument may further qualify this type.
sqlType
,
int
for java.sql.JDBCType.DECIMAL or java.sql.JDBCType.NUMERIC types, this is the number of digits after the decimal point. For Java Object types InputStream and Reader, this is the length of the data in the stream or reader. For all other types, this value will be ignored.
scaleOrLength
)

Overrides default java.sql.PreparedStatement.setObject.

Sets the value of the designated parameter with the given object.

public void
setObject(String
the name of the parameter
parameterName
,
Object
the object containing the input parameter value
x
,
SQLType
the SQL type to be sent to the database
sqlType
)

Overrides default java.sql.CallableStatement.setObject.

Sets the value of the designated parameter with the given object.
public void
setObject(String
the name of the parameter
parameterName
,
Object
the object containing the input parameter value
x
,
SQLType
the SQL type to be sent to the database. The scale argument may further qualify this type.
sqlType
,
int
for java.sql.JDBCType.DECIMAL or java.sql.JDBCType.NUMERIC types, this is the number of digits after the decimal point. For Java Object types InputStream and Reader, this is the length of the data in the stream or reader. For all other types, this value will be ignored.
scaleOrLength
)

Overrides default java.sql.CallableStatement.setObject.

Sets the value of the designated parameter with the given object.
Inherited from org.apache.derby.client.am.LogicalCallableStatement:
getArraygetArraygetBigDecimalgetBigDecimalgetBigDecimalgetBlobgetBlobgetBooleangetBooleangetBytegetBytegetBytesgetBytesgetCharacterStreamgetCharacterStreamgetClobgetClobgetDategetDategetDategetDategetDoublegetDoublegetFloatgetFloatgetIntgetIntgetLonggetLonggetNCharacterStreamgetNCharacterStreamgetNClobgetNClobgetNStringgetNStringgetObjectgetObjectgetObjectgetObjectgetObjectgetObjectgetRefgetRefgetRowIdgetRowIdgetShortgetShortgetSQLXMLgetSQLXMLgetStringgetStringgetTimegetTimegetTimegetTimegetTimestampgetTimestampgetTimestampgetTimestampgetURLgetURLregisterOutParameterregisterOutParameterregisterOutParameterregisterOutParameterregisterOutParameterregisterOutParametersetAsciiStreamsetAsciiStreamsetAsciiStreamsetBigDecimalsetBinaryStreamsetBinaryStreamsetBinaryStreamsetBlobsetBlobsetBlobsetBooleansetBytesetBytessetCharacterStreamsetCharacterStreamsetCharacterStreamsetClobsetClobsetClobsetDatesetDatesetDoublesetFloatsetIntsetLongsetNCharacterStreamsetNCharacterStreamsetNClobsetNClobsetNClobsetNStringsetNullsetNullsetObjectsetObjectsetObjectsetRowIdsetShortsetSQLXMLsetStringsetTimesetTimesetTimestampsetTimestampsetURLwasNull

Constructor Detail

LogicalCallableStatement42back to summary
public LogicalCallableStatement42(CallableStatement physicalCs, StatementKey stmtKey, StatementCacheInteractor cacheInteractor)

Creates a new logical callable statement.

Parameters
physicalCs:CallableStatement

underlying physical statement

stmtKey:StatementKey

key for the physical statement

cacheInteractor:StatementCacheInteractor

creating statement cache interactor

Exceptions
IllegalArgumentException:
if cache is null

Method Detail

registerOutParameterback to summary
public void registerOutParameter(int parameterIndex, SQLType sqlType) throws SQLException

Overrides default java.sql.CallableStatement.registerOutParameter.

Doc from java.sql.CallableStatement.registerOutParameter.

Registers the OUT parameter in ordinal position parameterIndex to the JDBC type sqlType. All OUT parameters must be registered before a stored procedure is executed.

The JDBC type specified by sqlType for an OUT parameter determines the Java type that must be used in the get method to read the value of that parameter.

If the JDBC type expected to be returned to this output parameter is specific to this particular database, sqlType may be JDBCType.OTHER or a SQLType that is supported by the JDBC driver. The method getObject retrieves the value.

The default implementation will throw SQLFeatureNotSupportedException

Parameters
parameterIndex:int

the first parameter is 1, the second is 2, and so on

sqlType:SQLType

the JDBC type code defined by SQLType to use to register the OUT Parameter. If the parameter is of JDBC type JDBCType.NUMERIC or JDBCType.DECIMAL, the version of registerOutParameter that accepts a scale value should be used.

Exceptions
SQLException:
if the parameterIndex is not valid; if a database access error occurs or this method is called on a closed CallableStatement
registerOutParameterback to summary
public void registerOutParameter(int parameterIndex, SQLType sqlType, int scale) throws SQLException

Overrides default java.sql.CallableStatement.registerOutParameter.

Doc from java.sql.CallableStatement.registerOutParameter.

Registers the parameter in ordinal position parameterIndex to be of JDBC type sqlType. All OUT parameters must be registered before a stored procedure is executed.

The JDBC type specified by sqlType for an OUT parameter determines the Java type that must be used in the get method to read the value of that parameter.

This version of registerOutParameter should be used when the parameter is of JDBC type JDBCType.NUMERIC or JDBCType.DECIMAL.

The default implementation will throw SQLFeatureNotSupportedException

Parameters
parameterIndex:int

the first parameter is 1, the second is 2, and so on

sqlType:SQLType

the JDBC type code defined by SQLType to use to register the OUT Parameter.

scale:int

the desired number of digits to the right of the decimal point. It must be greater than or equal to zero.

Exceptions
SQLException:
if the parameterIndex is not valid; if a database access error occurs or this method is called on a closed CallableStatement
registerOutParameterback to summary
public void registerOutParameter(int parameterIndex, SQLType sqlType, String typeName) throws SQLException

Overrides default java.sql.CallableStatement.registerOutParameter.

Doc from java.sql.CallableStatement.registerOutParameter.

Registers the designated output parameter. This version of the method registerOutParameter should be used for a user-defined or REF output parameter. Examples of user-defined types include: STRUCT, DISTINCT, JAVA_OBJECT, and named array types.

All OUT parameters must be registered before a stored procedure is executed.

For a user-defined 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-defined and REF parameters. Although it is intended for user-defined and REF parameters, this method may be used to register a parameter of any JDBC type. If the parameter does not have a user-defined or REF type, the typeName parameter is ignored.

Note

When reading the value of an out parameter, you must use the getter method whose Java type corresponds to the parameter's registered SQL type.

The default implementation will throw SQLFeatureNotSupportedException

Parameters
parameterIndex:int

the first parameter is 1, the second is 2,...

sqlType:SQLType

the JDBC type code defined by SQLType to use to register the OUT Parameter.

typeName:String

the fully-qualified name of an SQL structured type

Exceptions
SQLException:
if the parameterIndex is not valid; if a database access error occurs or this method is called on a closed CallableStatement
registerOutParameterback to summary
public void registerOutParameter(String parameterName, SQLType sqlType) throws SQLException

Overrides default java.sql.CallableStatement.registerOutParameter.

Doc from java.sql.CallableStatement.registerOutParameter.

Registers the OUT parameter named parameterName to the JDBC type sqlType. All OUT parameters must be registered before a stored procedure is executed.

The JDBC type specified by sqlType for an OUT parameter determines the Java type that must be used in the get method to read the value of that parameter.

If the JDBC type expected to be returned to this output parameter is specific to this particular database, sqlType should be JDBCType.OTHER or a SQLType that is supported by the JDBC driver.. The method getObject retrieves the value.

The default implementation will throw SQLFeatureNotSupportedException

Parameters
parameterName:String

the name of the parameter

sqlType:SQLType

the JDBC type code defined by SQLType to use to register the OUT Parameter. If the parameter is of JDBC type JDBCType.NUMERIC or JDBCType.DECIMAL, the version of registerOutParameter that accepts a scale value should be used.

Exceptions
SQLException:
if parameterName does not correspond to a named parameter; if a database access error occurs or this method is called on a closed CallableStatement
registerOutParameterback to summary
public void registerOutParameter(String parameterName, SQLType sqlType, int scale) throws SQLException

Overrides default java.sql.CallableStatement.registerOutParameter.

Doc from java.sql.CallableStatement.registerOutParameter.

Registers the parameter named parameterName to be of JDBC type sqlType. All OUT parameters must be registered before a stored procedure is executed.

The JDBC type specified by sqlType for an OUT parameter determines the Java type that must be used in the get method to read the value of that parameter.

This version of registerOutParameter should be used when the parameter is of JDBC type JDBCType.NUMERIC or JDBCType.DECIMAL.

The default implementation will throw SQLFeatureNotSupportedException

Parameters
parameterName:String

the name of the parameter

sqlType:SQLType

the JDBC type code defined by SQLType to use to register the OUT Parameter.

scale:int

the desired number of digits to the right of the decimal point. It must be greater than or equal to zero.

Exceptions
SQLException:
if parameterName does not correspond to a named parameter; if a database access error occurs or this method is called on a closed CallableStatement
registerOutParameterback to summary
public void registerOutParameter(String parameterName, SQLType sqlType, String typeName) throws SQLException

Overrides default java.sql.CallableStatement.registerOutParameter.

Doc from java.sql.CallableStatement.registerOutParameter.

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.

All OUT parameters must be registered before a stored procedure is executed.

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.

The default implementation will throw SQLFeatureNotSupportedException

Parameters
parameterName:String

the name of the parameter

sqlType:SQLType

the JDBC type code defined by SQLType to use to register the OUT Parameter.

typeName:String

the fully-qualified name of an SQL structured type

Exceptions
SQLException:
if parameterName does not correspond to a named parameter; if a database access error occurs or this method is called on a closed CallableStatement
setObjectback to summary
public void setObject(int parameterIndex, Object x, SQLType sqlType) throws SQLException

Overrides default java.sql.PreparedStatement.setObject.

Doc from java.sql.PreparedStatement.setObject.

Sets the value of the designated parameter with the given object. This method is similar to setObject(int parameterIndex, Object x, SQLType targetSqlType, int scaleOrLength), except that it assumes a scale of zero.

The default implementation will throw SQLFeatureNotSupportedException

Parameters
parameterIndex:int

the first parameter is 1, the second is 2, ...

x:Object

the object containing the input parameter value

sqlType:SQLType

the SQL type to be sent to the database

Exceptions
SQLException:
if parameterIndex does not correspond to a parameter marker in the SQL statement; if a database access error occurs or this method is called on a closed PreparedStatement
setObjectback to summary
public void setObject(int parameterIndex, Object x, SQLType sqlType, int scaleOrLength) throws SQLException

Overrides default java.sql.PreparedStatement.setObject.

Doc from java.sql.PreparedStatement.setObject.

Sets the value of the designated parameter with the given object. If the second argument is an InputStream then the stream must contain the number of bytes specified by scaleOrLength. If the second argument is a Reader then the reader must contain the number of characters specified by scaleOrLength. If these conditions are not true the driver will generate a SQLException when the prepared statement is executed.

The given Java object will be converted to the given targetSqlType before being sent to the database. If the object has a custom mapping (is of a class implementing the interface SQLData), the JDBC driver should call the method SQLData.writeSQL to write it to the SQL data stream. If, on the other hand, the object is of a class implementing Ref, Blob, Clob, NClob, Struct, java.net.URL, or Array, the driver should pass it to the database as a value of the corresponding SQL type.

Note that this method may be used to pass database-specific abstract data types.

The default implementation will throw SQLFeatureNotSupportedException

Parameters
parameterIndex:int

the first parameter is 1, the second is 2, ...

x:Object

the object containing the input parameter value

sqlType:SQLType

the SQL type to be sent to the database. The scale argument may further qualify this type.

scaleOrLength:int

for java.sql.JDBCType.DECIMAL or java.sql.JDBCType.NUMERIC types, this is the number of digits after the decimal point. For Java Object types InputStream and Reader, this is the length of the data in the stream or reader. For all other types, this value will be ignored.

Exceptions
SQLException:
if parameterIndex does not correspond to a parameter marker in the SQL statement; if a database access error occurs or this method is called on a closed PreparedStatement or if the Java Object specified by x is an InputStream or Reader object and the value of the scale parameter is less than zero
setObjectback to summary
public void setObject(String parameterName, Object x, SQLType sqlType) throws SQLException

Overrides default java.sql.CallableStatement.setObject.

Doc from java.sql.CallableStatement.setObject.

Sets the value of the designated parameter with the given object. This method is similar to setObject(String parameterName, Object x, SQLType targetSqlType, int scaleOrLength), except that it assumes a scale of zero.

The default implementation will throw SQLFeatureNotSupportedException

Parameters
parameterName:String

the name of the parameter

x:Object

the object containing the input parameter value

sqlType:SQLType

the SQL type to be sent to the database

Exceptions
SQLException:
if parameterName does not correspond to a named parameter; if a database access error occurs or this method is called on a closed CallableStatement
setObjectback to summary
public void setObject(String parameterName, Object x, SQLType sqlType, int scaleOrLength) throws SQLException

Overrides default java.sql.CallableStatement.setObject.

Doc from java.sql.CallableStatement.setObject.

Sets the value of the designated parameter with the given object. If the second argument is an InputStream then the stream must contain the number of bytes specified by scaleOrLength. If the second argument is a Reader then the reader must contain the number of characters specified by scaleOrLength. If these conditions are not true the driver will generate a SQLException when the prepared statement is executed.

The given Java object will be converted to the given targetSqlType before being sent to the database. If the object has a custom mapping (is of a class implementing the interface SQLData), the JDBC driver should call the method SQLData.writeSQL to write it to the SQL data stream. If, on the other hand, the object is of a class implementing Ref, Blob, Clob, NClob, Struct, java.net.URL, or Array, the driver should pass it to the database as a value of the corresponding SQL type.

Note that this method may be used to pass database-specific abstract data types.

The default implementation will throw SQLFeatureNotSupportedException

Parameters
parameterName:String

the name of the parameter

x:Object

the object containing the input parameter value

sqlType:SQLType

the SQL type to be sent to the database. The scale argument may further qualify this type.

scaleOrLength:int

for java.sql.JDBCType.DECIMAL or java.sql.JDBCType.NUMERIC types, this is the number of digits after the decimal point. For Java Object types InputStream and Reader, this is the length of the data in the stream or reader. For all other types, this value will be ignored.

Exceptions
SQLException:
if parameterName does not correspond to a named parameter; if a database access error occurs or this method is called on a closed CallableStatement or if the Java Object specified by x is an InputStream or Reader object and the value of the scale parameter is less than zero