Top Description Fields Constructors Methods
org.h2.jdbc

public final Class JdbcParameterMetaData

extends TraceObject
implements ParameterMetaData
Class Inheritance
All Implemented Interfaces
java.sql.ParameterMetaData, java.sql.Wrapper
Imports
java.sql.ParameterMetaData, .SQLException, java.util.ArrayList, org.h2.command.CommandInterface, org.h2.expression.ParameterInterface, org.h2.message.DbException, .Trace, .TraceObject, org.h2.util.MathUtils, org.h2.value.DataType, .TypeInfo, .Value, .ValueToObjectConverter

Information about the parameters of a prepared statement.

Field Summary

Modifier and TypeField and Description
private final int
private final ArrayList<? extends ParameterInterface>
private final JdbcPreparedStatement
Inherited from org.h2.message.TraceObject:
ARRAYBLOBCALLABLE_STATEMENTCLOBCONNECTIONDATA_SOURCEDATABASE_META_DATAPARAMETER_META_DATAPREPARED_STATEMENTRESULT_SETRESULT_SET_META_DATASAVEPOINTSQLXMLSTATEMENTtraceXA_DATA_SOURCEXID

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
private void
private ParameterInterface
getParameter(int param)

public String

Returns:

the Java class name
getParameterClassName
(int
the column index (1,2,...)
param
)

Implements java.sql.ParameterMetaData.getParameterClassName.

Returns the Java class name of the parameter.

public int

Returns:

the number
getParameterCount
()

Implements java.sql.ParameterMetaData.getParameterCount.

Returns the number of parameters.

public int

Returns:

parameterModeIn
getParameterMode
(int
the column index (1,2,...)
param
)

Implements java.sql.ParameterMetaData.getParameterMode.

Returns the parameter mode.

public int

Returns:

the data type
getParameterType
(int
the column index (1,2,...)
param
)

Implements java.sql.ParameterMetaData.getParameterType.

Returns the parameter type.

public String

Returns:

the type name
getParameterTypeName
(int
the column index (1,2,...)
param
)

Implements java.sql.ParameterMetaData.getParameterTypeName.

Returns the parameter type name.

public int

Returns:

the precision
getPrecision
(int
the column index (1,2,...)
param
)

Implements java.sql.ParameterMetaData.getPrecision.

Returns the parameter precision.

public int

Returns:

the scale
getScale
(int
the column index (1,2,...)
param
)

Implements java.sql.ParameterMetaData.getScale.

Returns the parameter scale.

public int

Returns:

ResultSetMetaData.columnNullableUnknown
isNullable
(int
the column index (1,2,...)
param
)

Implements java.sql.ParameterMetaData.isNullable.

Checks if this is nullable parameter.

public boolean

Returns:

true
isSigned
(int
the column index (1,2,...)
param
)

Implements java.sql.ParameterMetaData.isSigned.

Checks if this parameter is signed.

public boolean

Returns:

whether or not the interface is assignable from this class
isWrapperFor
(Class<?>
the class
iface
)

Implements java.sql.Wrapper.isWrapperFor.

Checks if unwrap can return an object of this class.

public String
toString()

Overrides java.lang.Object.toString.

INTERNAL

public <T> T

Returns:

this
unwrap
(Class<T>
the class
iface
)

Implements java.sql.Wrapper.unwrap.

Return an object of this class if possible.

Inherited from org.h2.message.TraceObject:
debugCodedebugCodeAssigndebugCodeCalldebugCodeCalldebugCodeCallgetNextIdgetTraceIdgetTraceObjectNameisDebugEnabledisInfoEnabledlogAndConvertquotequoteArrayquoteBigDecimalquoteBytesquoteDatequoteIntArrayquoteMapquoteTimequoteTimestampsetTraceunsupported

Field Detail

paramCountback to summary
private final int paramCount
parametersback to summary
private final ArrayList<? extends ParameterInterface> parameters
prepback to summary
private final JdbcPreparedStatement prep

Constructor Detail

JdbcParameterMetaDataback to summary
pack-priv JdbcParameterMetaData(Trace trace, JdbcPreparedStatement prep, CommandInterface command, int id)

Method Detail

checkClosedback to summary
private void checkClosed()
getParameterback to summary
private ParameterInterface getParameter(int param)
getParameterClassNameback to summary
public String getParameterClassName(int param) throws SQLException

Implements java.sql.ParameterMetaData.getParameterClassName.

Returns the Java class name of the parameter. "java.lang.String" is returned if the type is not known.

Parameters
param:int

the column index (1,2,...)

Returns:String

the Java class name

Annotations
@Override
Exceptions
SQLException:

Doc from java.sql.ParameterMetaData.getParameterClassName.

if a database access error occurs

getParameterCountback to summary
public int getParameterCount() throws SQLException

Implements java.sql.ParameterMetaData.getParameterCount.

Returns the number of parameters.

Returns:int

the number

Annotations
@Override
Exceptions
SQLException:

Doc from java.sql.ParameterMetaData.getParameterCount.

if a database access error occurs

getParameterModeback to summary
public int getParameterMode(int param) throws SQLException

Implements java.sql.ParameterMetaData.getParameterMode.

Returns the parameter mode. Always returns parameterModeIn.

Parameters
param:int

the column index (1,2,...)

Returns:int

parameterModeIn

Annotations
@Override
Exceptions
SQLException:

Doc from java.sql.ParameterMetaData.getParameterMode.

if a database access error occurs

getParameterTypeback to summary
public int getParameterType(int param) throws SQLException

Implements java.sql.ParameterMetaData.getParameterType.

Returns the parameter type. java.sql.Types.VARCHAR is returned if the data type is not known.

Parameters
param:int

the column index (1,2,...)

Returns:int

the data type

Annotations
@Override
Exceptions
SQLException:

Doc from java.sql.ParameterMetaData.getParameterType.

if a database access error occurs

getParameterTypeNameback to summary
public String getParameterTypeName(int param) throws SQLException

Implements java.sql.ParameterMetaData.getParameterTypeName.

Returns the parameter type name. "VARCHAR" is returned if the type is not known.

Parameters
param:int

the column index (1,2,...)

Returns:String

the type name

Annotations
@Override
Exceptions
SQLException:

Doc from java.sql.ParameterMetaData.getParameterTypeName.

if a database access error occurs

getPrecisionback to summary
public int getPrecision(int param) throws SQLException

Implements java.sql.ParameterMetaData.getPrecision.

Returns the parameter precision. The value 0 is returned if the precision is not known.

Parameters
param:int

the column index (1,2,...)

Returns:int

the precision

Annotations
@Override
Exceptions
SQLException:

Doc from java.sql.ParameterMetaData.getPrecision.

if a database access error occurs

getScaleback to summary
public int getScale(int param) throws SQLException

Implements java.sql.ParameterMetaData.getScale.

Returns the parameter scale. The value 0 is returned if the scale is not known.

Parameters
param:int

the column index (1,2,...)

Returns:int

the scale

Annotations
@Override
Exceptions
SQLException:

Doc from java.sql.ParameterMetaData.getScale.

if a database access error occurs

isNullableback to summary
public int isNullable(int param) throws SQLException

Implements java.sql.ParameterMetaData.isNullable.

Checks if this is nullable parameter. Returns ResultSetMetaData.columnNullableUnknown..

Parameters
param:int

the column index (1,2,...)

Returns:int

ResultSetMetaData.columnNullableUnknown

Annotations
@Override
Exceptions
SQLException:

Doc from java.sql.ParameterMetaData.isNullable.

if a database access error occurs

isSignedback to summary
public boolean isSigned(int param) throws SQLException

Implements java.sql.ParameterMetaData.isSigned.

Checks if this parameter is signed. It always returns true.

Parameters
param:int

the column index (1,2,...)

Returns:boolean

true

Annotations
@Override
Exceptions
SQLException:

Doc from java.sql.ParameterMetaData.isSigned.

if a database access error occurs

isWrapperForback to summary
public boolean isWrapperFor(Class<?> iface) throws SQLException

Implements java.sql.Wrapper.isWrapperFor.

Checks if unwrap can return an object of this class.

Parameters
iface:Class<?>

the class

Returns:boolean

whether or not the interface is assignable from this class

Annotations
@Override
Exceptions
SQLException:

Doc from java.sql.Wrapper.isWrapperFor.

if an error occurs while determining whether this is a wrapper for an object with the given interface.

toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

INTERNAL

Returns:String

Doc from java.lang.Object.toString.

a string representation of the object

Annotations
@Override
unwrapback to summary
public <T> T unwrap(Class<T> iface) throws SQLException

Implements java.sql.Wrapper.unwrap.

Return an object of this class if possible.

Parameters
<T>

Doc from java.sql.Wrapper.unwrap. the type of the class modeled by this Class object

iface:Class<T>

the class

Returns:T

this

Annotations
@Override
@SuppressWarnings:unchecked
Exceptions
SQLException:

Doc from java.sql.Wrapper.unwrap.

If no object found that implements the interface