Top Fields Constructors Methods
org.postgresql.jdbc

public Class PgParameterMetaData

extends Object
implements ParameterMetaData
Class Inheritance
All Implemented Interfaces
java.sql.ParameterMetaData, java.sql.Wrapper
Static Imports
org.postgresql.util.internal.Nullness.castNonNull

Field Summary

Modifier and TypeField and Description
private final BaseConnection
private final int[]

Constructor Summary

AccessConstructor and Description
public
PgParameterMetaData(BaseConnection connection, int[] oids)

Method Summary

Modifier and TypeMethod and Description
private void
checkParamIndex(int param)

public String
getParameterClassName(@Positive int
the first parameter is 1, the second is 2, ...
param
)

Implements java.sql.ParameterMetaData.getParameterClassName.

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

public int
getParameterCount()

Implements java.sql.ParameterMetaData.getParameterCount.

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

public int
getParameterMode(int
the first parameter is 1, the second is 2, ...
param
)

Implements java.sql.ParameterMetaData.getParameterMode.

Retrieves the designated parameter's mode.

public int
getParameterType(int
the first parameter is 1, the second is 2, ...
param
)

Implements java.sql.ParameterMetaData.getParameterType.

Retrieves the designated parameter's SQL type.

public String
getParameterTypeName(int
the first parameter is 1, the second is 2, ...
param
)

Implements java.sql.ParameterMetaData.getParameterTypeName.

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

public int
getPrecision(int
the first parameter is 1, the second is 2, ...
param
)

Implements java.sql.ParameterMetaData.getPrecision.

Retrieves the designated parameter's specified column size.

public int
getScale(int
the first parameter is 1, the second is 2, ...
param
)

Implements java.sql.ParameterMetaData.getScale.

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

public int
isNullable(int
the first parameter is 1, the second is 2, ...
param
)

Implements java.sql.ParameterMetaData.isNullable.

Retrieves whether null values are allowed in the designated parameter.

public boolean
isSigned(int
the first parameter is 1, the second is 2, ...
param
)

Implements java.sql.ParameterMetaData.isSigned.

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

public boolean
isWrapperFor(Class<?>
a Class defining an interface.
iface
)

Implements java.sql.Wrapper.isWrapperFor.

Returns true if this either implements the interface argument or is directly or indirectly a wrapper for an object that does.

public <T> T
unwrap(Class<T>
A Class defining an interface that the result must implement.
iface
)

Implements java.sql.Wrapper.unwrap.

Returns an object that implements the given interface to allow access to non-standard methods, or standard methods not exposed by the proxy.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

connectionback to summary
private final BaseConnection connection
oidsback to summary
private final int[] oids

Constructor Detail

PgParameterMetaDataback to summary
public PgParameterMetaData(BaseConnection connection, int[] oids)

Method Detail

checkParamIndexback to summary
private void checkParamIndex(int param) throws PSQLException
getParameterClassNameback to summary
public String getParameterClassName(@Positive int param) throws SQLException

Implements java.sql.ParameterMetaData.getParameterClassName.

Doc from java.sql.ParameterMetaData.getParameterClassName.

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

Parameters
param:@Positive int

the first parameter is 1, the second is 2, ...

Returns: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.

Annotations
@Override
Exceptions
SQLException:
if a database access error occurs
getParameterCountback to summary
public int getParameterCount()

Implements java.sql.ParameterMetaData.getParameterCount.

Doc from java.sql.ParameterMetaData.getParameterCount.

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

Returns:int

the number of parameters

Annotations
@Override
getParameterModeback to summary
public int getParameterMode(int param) throws SQLException

Implements java.sql.ParameterMetaData.getParameterMode.

Doc from java.sql.ParameterMetaData.getParameterMode.

Retrieves the designated parameter's mode. For now report all parameters as inputs. CallableStatements may have one output, but ignore that for now.

Parameters
param:int

the first parameter is 1, the second is 2, ...

Returns:int

mode of the parameter; one of ParameterMetaData.parameterModeIn, ParameterMetaData.parameterModeOut, or ParameterMetaData.parameterModeInOut ParameterMetaData.parameterModeUnknown.

Annotations
@Override
Exceptions
SQLException:
if a database access error occurs
getParameterTypeback to summary
public int getParameterType(int param) throws SQLException

Implements java.sql.ParameterMetaData.getParameterType.

Doc from java.sql.ParameterMetaData.getParameterType.

Retrieves the designated parameter's SQL type.

Parameters
param:int

the first parameter is 1, the second is 2, ...

Returns:int

SQL type from java.sql.Types

Annotations
@Override
Exceptions
SQLException:
if a database access error occurs
getParameterTypeNameback to summary
public String getParameterTypeName(int param) throws SQLException

Implements java.sql.ParameterMetaData.getParameterTypeName.

Doc from java.sql.ParameterMetaData.getParameterTypeName.

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

Parameters
param:int

the first parameter is 1, the second is 2, ...

Returns: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.

Annotations
@Override
Exceptions
SQLException:
if a database access error occurs
getPrecisionback to summary
public int getPrecision(int param) throws SQLException

Implements java.sql.ParameterMetaData.getPrecision.

Doc from java.sql.ParameterMetaData.getPrecision.

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, ...

Returns:int

precision

Annotations
@Override
Exceptions
SQLException:
if a database access error occurs
getScaleback to summary
public int getScale(int param) throws SQLException

Implements java.sql.ParameterMetaData.getScale.

Doc from java.sql.ParameterMetaData.getScale.

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, ...

Returns:int

scale

Annotations
@Override
Exceptions
SQLException:
if a database access error occurs
isNullableback to summary
public int isNullable(int param) throws SQLException

Implements java.sql.ParameterMetaData.isNullable.

Doc from java.sql.ParameterMetaData.isNullable.

Retrieves whether null values are allowed in the designated parameter.

Parameters
param:int

the first parameter is 1, the second is 2, ...

Returns:int

the nullability status of the given parameter; one of ParameterMetaData.parameterNoNulls, ParameterMetaData.parameterNullable, or ParameterMetaData.parameterNullableUnknown

Annotations
@Override
Exceptions
SQLException:
if a database access error occurs
isSignedback to summary
public boolean isSigned(int param) throws SQLException

Implements java.sql.ParameterMetaData.isSigned.

Doc from java.sql.ParameterMetaData.isSigned.

Retrieves whether values for the designated parameter can be signed numbers. PostgreSQL doesn't have unsigned numbers

Parameters
param:int

the first parameter is 1, the second is 2, ...

Returns:boolean

true if so; false otherwise

Annotations
@Override
Exceptions
SQLException:
if a database access error occurs
isWrapperForback to summary
public boolean isWrapperFor(Class<?> iface) throws SQLException

Implements java.sql.Wrapper.isWrapperFor.

Doc from java.sql.Wrapper.isWrapperFor.

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.

Parameters
iface:Class<?>

a Class defining an interface.

Returns:boolean

true if this implements the interface or directly or indirectly wraps an object that does.

Annotations
@Override
Exceptions
SQLException:
if an error occurs while determining whether this is a wrapper for an object with the given interface.
unwrapback to summary
public <T> T unwrap(Class<T> iface) throws SQLException

Implements java.sql.Wrapper.unwrap.

Doc from java.sql.Wrapper.unwrap.

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.

Parameters
<T>
the type of the class modeled by this Class object
iface:Class<T>

A Class defining an interface that the result must implement.

Returns:T

an object that implements the interface. May be a proxy for the actual implementing object.

Annotations
@Override
Exceptions
SQLException:
If no object found that implements the interface