Added in API level 1

ParameterMetaData

interface ParameterMetaData : Wrapper

An object that can be used to get information about the types and properties for each parameter marker in a PreparedStatement object. For some queries and driver implementations, the data that would be returned by a ParameterMetaData object may not be available until the PreparedStatement has been executed.

Some driver implementations may not be able to provide information about the types and properties for each parameter marker in a CallableStatement object.

Summary

Constants
static Int

The constant indicating that the parameter's mode is IN.

static Int

The constant indicating that the parameter's mode is INOUT.

static Int

The constant indicating that the parameter's mode is OUT.

static Int

The constant indicating that the mode of the parameter is unknown.

static Int

The constant indicating that a parameter will not allow NULL values.

static Int

The constant indicating that a parameter will allow NULL values.

static Int

The constant indicating that the nullability of a parameter is unknown.

Public methods
abstract String!

Retrieves the fully-qualified name of the Java class whose instances should be passed to the method PreparedStatement.setObject.

abstract Int

Retrieves the number of parameters in the PreparedStatement object for which this ParameterMetaData object contains information.

abstract Int

Retrieves the designated parameter's mode.

abstract Int

Retrieves the designated parameter's SQL type.

abstract String!

Retrieves the designated parameter's database-specific type name.

abstract Int
getPrecision(param: Int)

Retrieves the designated parameter's specified column size.

abstract Int
getScale(param: Int)

Retrieves the designated parameter's number of digits to right of the decimal point.

abstract Int
isNullable(param: Int)

Retrieves whether null values are allowed in the designated parameter.

abstract Boolean
isSigned(param: Int)

Retrieves whether values for the designated parameter can be signed numbers.

Inherited functions
Boolean isWrapperFor(iface: Class<*>!)

Returns true if this either implements the interface argument or is directly or indirectly a wrapper for an object that does. Returns false otherwise. If this implements the interface then return true, else if this is a wrapper then return the result of recursively calling isWrapperFor on the wrapped object. If this does not implement the interface and is not a wrapper, return false. This method should be implemented as a low-cost operation compared to unwrap so that callers can use this method to avoid expensive unwrap calls that may fail. If this method returns true then calling unwrap with the same argument should succeed.

T unwrap(iface: Class<T>!)

Returns an object that implements the given interface to allow access to non-standard methods, or standard methods not exposed by the proxy. If the receiver implements the interface then the result is the receiver or a proxy for the receiver. If the receiver is a wrapper and the wrapped object implements the interface then the result is the wrapped object or a proxy for the wrapped object. Otherwise return the the result of calling unwrap recursively on the wrapped object or a proxy for that result. If the receiver is not a wrapper and does not implement the interface, then an SQLException is thrown.

Constants

parameterModeIn

Added in API level 1
static val parameterModeIn: Int

The constant indicating that the parameter's mode is IN.

Value: 1

parameterModeInOut

Added in API level 1
static val parameterModeInOut: Int

The constant indicating that the parameter's mode is INOUT.

Value: 2

parameterModeOut

Added in API level 1
static val parameterModeOut: Int

The constant indicating that the parameter's mode is OUT.

Value: 4

parameterModeUnknown

Added in API level 1
static val parameterModeUnknown: Int

The constant indicating that the mode of the parameter is unknown.

Value: 0

parameterNoNulls

Added in API level 1
static val parameterNoNulls: Int

The constant indicating that a parameter will not allow NULL values.

Value: 0

parameterNullable

Added in API level 1
static val parameterNullable: Int

The constant indicating that a parameter will allow NULL values.

Value: 1

parameterNullableUnknown

Added in API level 1
static val parameterNullableUnknown: Int

The constant indicating that the nullability of a parameter is unknown.

Value: 2

Public methods

getParameterClassName

Added in API level 1
abstract fun getParameterClassName(param: Int): String!

Retrieves the fully-qualified name of the Java class whose instances should be passed to the method PreparedStatement.setObject.

Parameters
param Int: the first parameter is 1, the second is 2, ...
Return
String! the fully-qualified name of the class in the Java programming language that would be used by the method PreparedStatement.setObject to set the value in the specified parameter. This is the class name used for custom mapping.
Exceptions
java.sql.SQLException if a database access error occurs

getParameterCount

Added in API level 1
abstract fun getParameterCount(): Int

Retrieves the number of parameters in the PreparedStatement object for which this ParameterMetaData object contains information.

Return
Int the number of parameters
Exceptions
java.sql.SQLException if a database access error occurs

getParameterMode

Added in API level 1
abstract fun getParameterMode(param: Int): Int

Retrieves the designated parameter's mode.

Parameters
param Int: the first parameter is 1, the second is 2, ...
Return
Int mode of the parameter; one of ParameterMetaData.parameterModeIn, ParameterMetaData.parameterModeOut, or ParameterMetaData.parameterModeInOut ParameterMetaData.parameterModeUnknown.
Exceptions
java.sql.SQLException if a database access error occurs

getParameterType

Added in API level 1
abstract fun getParameterType(param: Int): Int

Retrieves the designated parameter's SQL type.

Parameters
param Int: the first parameter is 1, the second is 2, ...
Return
Int SQL type from java.sql.Types
Exceptions
java.sql.SQLException if a database access error occurs

See Also

getParameterTypeName

Added in API level 1
abstract fun getParameterTypeName(param: Int): String!

Retrieves the designated parameter's database-specific type name.

Parameters
param Int: the first parameter is 1, the second is 2, ...
Return
String! type the name used by the database. If the parameter type is a user-defined type, then a fully-qualified type name is returned.
Exceptions
java.sql.SQLException if a database access error occurs

getPrecision

Added in API level 1
abstract fun getPrecision(param: Int): Int

Retrieves the designated parameter's specified column size.

The returned value represents the maximum column size for the given parameter. For numeric data, this is the maximum precision. For character data, this is the length in characters. For datetime datatypes, this is the length in characters of the String representation (assuming the maximum allowed precision of the fractional seconds component). For binary data, this is the length in bytes. For the ROWID datatype, this is the length in bytes. 0 is returned for data types where the column size is not applicable.

Parameters
param Int: the first parameter is 1, the second is 2, ...
Return
Int precision
Exceptions
java.sql.SQLException if a database access error occurs

getScale

Added in API level 1
abstract fun getScale(param: Int): Int

Retrieves the designated parameter's number of digits to right of the decimal point. 0 is returned for data types where the scale is not applicable.

Parameters
param Int: the first parameter is 1, the second is 2, ...
Return
Int scale
Exceptions
java.sql.SQLException if a database access error occurs

isNullable

Added in API level 1
abstract fun isNullable(param: Int): Int

Retrieves whether null values are allowed in the designated parameter.

Parameters
param Int: the first parameter is 1, the second is 2, ...
Return
Int the nullability status of the given parameter; one of ParameterMetaData.parameterNoNulls, ParameterMetaData.parameterNullable, or ParameterMetaData.parameterNullableUnknown
Exceptions
java.sql.SQLException if a database access error occurs

isSigned

Added in API level 1
abstract fun isSigned(param: Int): Boolean

Retrieves whether values for the designated parameter can be signed numbers.

Parameters
param Int: the first parameter is 1, the second is 2, ...
Return
Boolean true if so; false otherwise
Exceptions
java.sql.SQLException if a database access error occurs