Build 1.0_r1(from source)

java.sql
Interface ParameterMetaData


public interface ParameterMetaData

An interface used to get information about the types and properties of parameters in a PreparedStatement object.


Field Summary
static int parameterModeIn
          Indicates that the parameter mode is IN.
static int parameterModeInOut
          Indicates that the parameter mode is INOUT.
static int parameterModeOut
          Indicates that the parameter mode is OUT.
static int parameterModeUnknown
          Indicates that the parameter mode is not known.
static int parameterNoNulls
          Indicates that a parameter is not permitted to be NULL.
static int parameterNullable
          Indicates that a parameter is permitted to be NULL.
static int parameterNullableUnknown
          Indicates that whether a parameter is allowed to be null or not is not known.
 
Method Summary
 String getParameterClassName(int paramIndex)
          Gets the fully-qualified name of the Java class which should be passed as a parameter to the method PreparedStatement.setObject.
 int getParameterCount()
          Gets the number of parameters in the PreparedStatement for which this ParameterMetaData contains information.
 int getParameterMode(int paramIndex)
          Gets the mode of the specified parameter.
 int getParameterType(int paramIndex)
          Gets the SQL type of a specified parameter.
 String getParameterTypeName(int paramIndex)
          Gets the database-specific type name of a specified parameter.
 int getPrecision(int paramIndex)
          Gets the number of decimal digits for a specified parameter.
 int getScale(int paramIndex)
          Gets the number of digits after the decimal point for a specified parameter.
 int isNullable(int paramIndex)
          Gets whether null values are allowed for the specified parameter.
 boolean isSigned(int paramIndex)
          Gets whether values for the specified parameter can be signed numbers.
 

Field Detail

parameterModeIn

static final int parameterModeIn
Indicates that the parameter mode is IN.

See Also:
Constant Field Values

parameterModeInOut

static final int parameterModeInOut
Indicates that the parameter mode is INOUT.

See Also:
Constant Field Values

parameterModeOut

static final int parameterModeOut
Indicates that the parameter mode is OUT.

See Also:
Constant Field Values

parameterModeUnknown

static final int parameterModeUnknown
Indicates that the parameter mode is not known.

See Also:
Constant Field Values

parameterNoNulls

static final int parameterNoNulls
Indicates that a parameter is not permitted to be NULL.

See Also:
Constant Field Values

parameterNullable

static final int parameterNullable
Indicates that a parameter is permitted to be NULL.

See Also:
Constant Field Values

parameterNullableUnknown

static final int parameterNullableUnknown
Indicates that whether a parameter is allowed to be null or not is not known.

See Also:
Constant Field Values
Method Detail

getParameterClassName

String getParameterClassName(int paramIndex)
                             throws SQLException
Gets the fully-qualified name of the Java class which should be passed as a parameter to the method PreparedStatement.setObject.

Parameters:
paramIndex - the index number of the parameter, where the first parameter has an index of 1
Returns:
a String with the fully qualified Java class name of the parameter with the specified index. This class name is used for custom mapping.
Throws:
SQLException - if a database error happens

getParameterCount

int getParameterCount()
                      throws SQLException
Gets the number of parameters in the PreparedStatement for which this ParameterMetaData contains information.

Returns:
the number of parameters as an int
Throws:
SQLException - if a database error happens

getParameterMode

int getParameterMode(int paramIndex)
                     throws SQLException
Gets the mode of the specified parameter.

Parameters:
paramIndex - the index number of the parameter, where the first parameter has an index of 1
Returns:
the parameters mode. Can be: ParameterMetaData.parameterModeIn, ParameterMetaData.parameterModeOut, ParameterMetaData.parameterModeInOut or ParameterMetaData.parameterModeUnknown.
Throws:
SQLException - if a database error happens

getParameterType

int getParameterType(int paramIndex)
                     throws SQLException
Gets the SQL type of a specified parameter.

Parameters:
paramIndex - the index number of the parameter, where the first parameter has an index of 1
Returns:
the type of the parameter - an SQL type as defined in java.sql.Types.
Throws:
SQLException - if a database error happens

getParameterTypeName

String getParameterTypeName(int paramIndex)
                            throws SQLException
Gets the database-specific type name of a specified parameter.

Parameters:
paramIndex - the index number of the parameter, where the first parameter has an index of 1
Returns:
the type name for the parameter as used by the database. A fully-qualified name is returned if the parameter is a User Defined Type.
Throws:
SQLException - if a database error happens

getPrecision

int getPrecision(int paramIndex)
                 throws SQLException
Gets the number of decimal digits for a specified parameter.

Parameters:
paramIndex - the index number of the parameter, where the first parameter has an index of 1
Returns:
the number of decimal digits ("the precision") for the parameter. 0 if the parameter is not a numeric type.
Throws:
SQLException - if a database error happens

getScale

int getScale(int paramIndex)
             throws SQLException
Gets the number of digits after the decimal point for a specified parameter.

Parameters:
paramIndex - the index number of the parameter, where the first parameter has an index of 1
Returns:
the number of digits after the decimal point ("the scale") for the parameter. 0 if the parameter is not a numeric type.
Throws:
SQLException - if a database error happens

isNullable

int isNullable(int paramIndex)
               throws SQLException
Gets whether null values are allowed for the specified parameter.

Parameters:
paramIndex - the index number of the parameter, where the first parameter has an index of 1
Returns:
indicator of nullability, can be: ParameterMetaData.parameterNoNulls, ParameterMetaData.parameterNullable, or ParameterMetaData.parameterNullableUnknown
Throws:
SQLException - if a database error is encountered

isSigned

boolean isSigned(int paramIndex)
                 throws SQLException
Gets whether values for the specified parameter can be signed numbers.

Parameters:
paramIndex - the index number of the parameter, where the first parameter has an index of 1
Returns:
true if values can be signed numbers for this parameter, false otherwise.
Throws:
SQLException - if a database error happens

Build 1.0_r1(from source)

Please submit a feedback, bug or feature