java.sql
public
interface
java.sql.ParameterMetaData
java.sql.ParameterMetaData |
|
An interface used to get information about the types and properties of
parameters in a PreparedStatement object.
Summary
Details
Constants
public
static
final
int
parameterModeIn
Indicates that the parameter mode is IN.
Constant Value:
1
(0x00000001)
public
static
final
int
parameterModeInOut
Indicates that the parameter mode is INOUT.
Constant Value:
2
(0x00000002)
public
static
final
int
parameterModeOut
Indicates that the parameter mode is OUT.
Constant Value:
4
(0x00000004)
public
static
final
int
parameterModeUnknown
Indicates that the parameter mode is not known.
Constant Value:
0
(0x00000000)
public
static
final
int
parameterNoNulls
Indicates that a parameter is not permitted to be NULL.
Constant Value:
0
(0x00000000)
public
static
final
int
parameterNullable
Indicates that a parameter is permitted to be NULL.
Constant Value:
1
(0x00000001)
public
static
final
int
parameterNullableUnknown
Indicates that whether a parameter is allowed to be null or not is not
known.
Constant Value:
2
(0x00000002)
Public Methods
public
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
.
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.
public
int
getParameterCount()
Gets the number of parameters in the PreparedStatement for which this
ParameterMetaData contains information.
Returns
- the number of parameters as an int
public
int
getParameterMode(int paramIndex)
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.
public
int
getParameterType(int paramIndex)
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.
public
String
getParameterTypeName(int paramIndex)
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.
public
int
getPrecision(int paramIndex)
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.
public
int
getScale(int paramIndex)
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.
public
int
isNullable(int paramIndex)
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
public
boolean
isSigned(int paramIndex)
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.