Share via


CallableStatement.registerOutParameter

Interface Overview | Interface Members | This Package | All Packages

Syntax 1

public abstract void registerOutParameter( int parameterIndex**, int** sqlType ) throws SQLException

Parameters
  • parameterIndex
    the first parameter is 1, the second is 2,...
  • sqlType
    SQL type code defined by java.sql.Types; for parameters of type Numeric or Decimal use the version of registerOutParameter that accepts a scale value
Description

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.

Exceptions

SQLException if a database-access error occurs.

See Also

Type

Syntax 2

public abstract void registerOutParameter( int parameterIndex**, int** sqlType**, int** scale ) throws SQLException

Parameters
  • parameterIndex
    the first parameter is 1, the second is 2, ...
  • sqlType
    use either java.sql.Type.NUMERIC or java.sql.Type.DECIMAL
  • scale
    a value greater than or equal to zero representing the desired number of digits to the right of the decimal point
Description

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.

Exceptions

SQLException if a database-access error occurs.

See Also

Type