public class PgParameterMetaData extends Object implements ParameterMetaData
parameterModeIn, parameterModeInOut, parameterModeOut, parameterModeUnknown, parameterNoNulls, parameterNullable, parameterNullableUnknown| Constructor and Description |
|---|
PgParameterMetaData(BaseConnection connection,
int[] oids) |
| Modifier and Type | Method and Description |
|---|---|
String |
getParameterClassName(int param)
Retrieves the fully-qualified name of the Java class whose instances
should be passed to the method
PreparedStatement.setObject. |
int |
getParameterCount()
Retrieves the number of parameters in the
PreparedStatement
object for which this ParameterMetaData object contains
information. |
int |
getParameterMode(int param)
Retrieves the designated parameter's mode.
|
int |
getParameterType(int param)
Retrieves the designated parameter's SQL type.
|
String |
getParameterTypeName(int param)
Retrieves the designated parameter's database-specific type name.
|
int |
getPrecision(int param)
Retrieves the designated parameter's specified column size.
|
int |
getScale(int param)
Retrieves the designated parameter's number of digits to right of the decimal point.
|
int |
isNullable(int param)
Retrieves whether null values are allowed in the designated parameter.
|
boolean |
isSigned(int param)
Retrieves whether values for the designated parameter can be signed numbers.
|
boolean |
isWrapperFor(Class<?> iface)
Returns true if this either implements the interface argument or is directly or indirectly a wrapper
for an object that does.
|
<T> T |
unwrap(Class<T> iface)
Returns an object that implements the given interface to allow access to
non-standard methods, or standard methods not exposed by the proxy.
|
public PgParameterMetaData(BaseConnection connection, int[] oids)
public String getParameterClassName(int param) throws SQLException
java.sql.ParameterMetaDataPreparedStatement.setObject.getParameterClassName in interface ParameterMetaDataparam - the first parameter is 1, the second is 2, ...PreparedStatement.setObject to set the value
in the specified parameter. This is the class name used
for custom mapping.SQLException - if a database access error occurspublic int getParameterCount()
java.sql.ParameterMetaDataPreparedStatement
object for which this ParameterMetaData object contains
information.getParameterCount in interface ParameterMetaDatapublic int getParameterMode(int param)
throws SQLException
getParameterMode in interface ParameterMetaDataparam - the first parameter is 1, the second is 2, ...ParameterMetaData.parameterModeIn,
ParameterMetaData.parameterModeOut, or
ParameterMetaData.parameterModeInOut
ParameterMetaData.parameterModeUnknown.SQLException - if a database access error occurspublic int getParameterType(int param)
throws SQLException
java.sql.ParameterMetaDatagetParameterType in interface ParameterMetaDataparam - the first parameter is 1, the second is 2, ...java.sql.TypesSQLException - if a database access error occursTypespublic String getParameterTypeName(int param) throws SQLException
java.sql.ParameterMetaDatagetParameterTypeName in interface ParameterMetaDataparam - the first parameter is 1, the second is 2, ...SQLException - if a database access error occurspublic int getPrecision(int param)
throws SQLException
java.sql.ParameterMetaDataThe 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.
getPrecision in interface ParameterMetaDataparam - the first parameter is 1, the second is 2, ...SQLException - if a database access error occurspublic int getScale(int param)
throws SQLException
java.sql.ParameterMetaDatagetScale in interface ParameterMetaDataparam - the first parameter is 1, the second is 2, ...SQLException - if a database access error occurspublic int isNullable(int param)
throws SQLException
java.sql.ParameterMetaDataisNullable in interface ParameterMetaDataparam - the first parameter is 1, the second is 2, ...ParameterMetaData.parameterNoNulls,
ParameterMetaData.parameterNullable, or
ParameterMetaData.parameterNullableUnknownSQLException - if a database access error occurspublic boolean isSigned(int param)
throws SQLException
isSigned in interface ParameterMetaDataparam - the first parameter is 1, the second is 2, ...true if so; false otherwiseSQLException - if a database access error occurspublic boolean isWrapperFor(Class<?> iface) throws SQLException
java.sql.WrapperisWrapperFor 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.isWrapperFor in interface Wrapperiface - a Class defining an interface.SQLException - if an error occurs while determining whether this is a wrapper
for an object with the given interface.public <T> T unwrap(Class<T> iface) throws SQLException
java.sql.Wrapperunwrap 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.unwrap in interface WrapperT - the type of the class modeled by this Class objectiface - A Class defining an interface that the result must implement.SQLException - If no object found that implements the interfaceCopyright © 2018 PostgreSQL Global Development Group. All rights reserved.