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.
parameterIndex | the first parameter is 1, the second is 2,... | |
sqlType | a value from java.sql.Types | |
typeName | the fully-qualified name of an SQL structured type |
SQLException | if the parameterIndex is not valid;
if a database access error occurs or
this method is called on a closed CallableStatement | |
SQLFeatureNotSupportedException | if sqlType is
a ARRAY , BLOB , CLOB ,
DATALINK , JAVA_OBJECT , NCHAR ,
NCLOB , NVARCHAR , LONGNVARCHAR ,
REF , ROWID , SQLXML
or STRUCT data type and the JDBC driver does not support
this data type |
Types
Diagram: Statement