FileDocCategorySizeDatePackage
ParameterMetaData.javaAPI DocAndroid 1.5 API7355Wed May 06 22:41:06 BST 2009java.sql

ParameterMetaData

public interface ParameterMetaData
An interface used to get information about the types and properties of parameters in a {@code PreparedStatement}.
since
Android 1.0

Fields Summary
public static final int
parameterModeIn
Indicates that the parameter mode is {@code IN}.
public static final int
parameterModeInOut
Indicates that the parameter mode is {@code INOUT}.
public static final int
parameterModeOut
Indicates that the parameter mode is {@code OUT}.
public static final int
parameterModeUnknown
Indicates that the parameter mode is not known.
public static final int
parameterNoNulls
Indicates that a parameter is not permitted to be {@code NULL}.
public static final int
parameterNullable
Indicates that a parameter is permitted to be {@code NULL}.
public static final int
parameterNullableUnknown
Indicates that whether a parameter is allowed to be {@code null} or not is not known.
Constructors Summary
Methods Summary
public java.lang.StringgetParameterClassName(int paramIndex)
Gets the fully-qualified name of the Java class which should be passed as a parameter to the method {@code PreparedStatement.setObject}.

param
paramIndex the index number of the parameter, where the first parameter has index 1.
return
the fully qualified Java class name of the parameter with the specified index. This class name is used for custom mapping between SQL types and Java objects.
throws
SQLException if a database error happens.
since
Android 1.0

public intgetParameterCount()
Gets the number of parameters in the {@code PreparedStatement} for which this {@code ParameterMetaData} contains information.

return
the number of parameters.
throws
SQLException if a database error happens.
since
Android 1.0

public intgetParameterMode(int paramIndex)
Gets the mode of the specified parameter. Can be one of:
  • ParameterMetaData.parameterModeIn
  • ParameterMetaData.parameterModeOut
  • ParameterMetaData.parameterModeInOut
  • ParameterMetaData.parameterModeUnknown

param
paramIndex the index number of the parameter, where the first parameter has index 1.
return
the parameter's mode.
throws
SQLException if a database error happens.
since
Android 1.0

public intgetParameterType(int paramIndex)
Gets the SQL type of a specified parameter.

param
paramIndex the index number of the parameter, where the first parameter has index 1.
return
the SQL type of the parameter as defined in {@code java.sql.Types}.
throws
SQLException if a database error happens.
since
Android 1.0

public java.lang.StringgetParameterTypeName(int paramIndex)
Gets the database-specific type name of a specified parameter.

param
paramIndex the index number of the parameter, where the first parameter has index 1.
return
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 (UDT).
throws
SQLException if a database error happens.
since
Android 1.0

public intgetPrecision(int paramIndex)
Gets the number of decimal digits for a specified parameter.

param
paramIndex the index number of the parameter, where the first parameter has index 1.
return
the number of decimal digits ("the precision") for the parameter. {@code 0} if the parameter is not a numeric type.
throws
SQLException if a database error happens.
since
Android 1.0

public intgetScale(int paramIndex)
Gets the number of digits after the decimal point for a specified parameter.

param
paramIndex the index number of the parameter, where the first parameter has index 1.
return
the number of digits after the decimal point ("the scale") for the parameter. {@code 0} if the parameter is not a numeric type.
throws
SQLException if a database error happens.
since
Android 1.0

public intisNullable(int paramIndex)
Gets whether {@code null} values are allowed for the specified parameter. The returned value is one of:
  • ParameterMetaData.parameterNoNulls
  • ParameterMetaData.parameterNullable
  • ParameterMetaData.parameterNullableUnknown

param
paramIndex the index number of the parameter, where the first parameter has index 1.
return
the int code indicating the nullability of the parameter.
throws
SQLException if a database error is encountered.
since
Android 1.0

public booleanisSigned(int paramIndex)
Gets whether values for the specified parameter can be signed numbers.

param
paramIndex the index number of the parameter, where the first parameter has index 1.
return
{@code true} if values can be signed numbers for this parameter, {@code false} otherwise.
throws
SQLException if a database error happens.
since
Android 1.0