public class ParameterMetaData extends Object implements ParameterMetaData
parameterModeIn, parameterModeInOut, parameterModeOut, parameterModeUnknown, parameterNoNulls, parameterNullable, parameterNullableUnknown| Constructor and Description |
|---|
ParameterMetaData(ExceptionFactory exceptionFactory,
ColumnDefinitionPacket[] params) |
| Modifier and Type | Method and Description |
|---|---|
String |
getParameterClassName(int idx)
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 idx)
Retrieves the designated parameter's mode.
|
int |
getParameterType(int param)
Retrieves the designated parameter's SQL type.
|
String |
getParameterTypeName(int idx)
Retrieves the designated parameter's database-specific type name.
|
int |
getPrecision(int idx)
Retrieves the designated parameter's specified column size.
|
int |
getScale(int idx)
Retrieves the designated parameter's number of digits to right of the decimal point.
|
int |
isNullable(int idx)
Retrieves whether null values are allowed in the designated parameter.
|
boolean |
isSigned(int idx)
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 ParameterMetaData(ExceptionFactory exceptionFactory, ColumnDefinitionPacket[] params)
public int getParameterCount()
PreparedStatement object for which this
ParameterMetaData object contains information.getParameterCount in interface ParameterMetaDatapublic int isNullable(int idx)
throws SQLException
isNullable in interface ParameterMetaDataidx - the first parameter is 1, the second is 2, ...
ParameterMetaData.parameterNoNulls, ParameterMetaData.parameterNullableSQLException - if wrong indexpublic boolean isSigned(int idx)
throws SQLException
isSigned in interface ParameterMetaDataidx - the first parameter is 1, the second is 2, ...true if so; false otherwiseSQLException - if wrong indexpublic int getPrecision(int idx)
throws SQLException
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.
getPrecision in interface ParameterMetaDataidx - the first parameter is 1, the second is 2, ...SQLException - if wrong indexpublic int getScale(int idx)
throws SQLException
getScale in interface ParameterMetaDataidx - the first parameter is 1, the second is 2, ...SQLException - if a database access error occurspublic int getParameterType(int param)
throws SQLException
getParameterType in interface ParameterMetaDataparam - the first parameter is 1, the second is 2, ...java.sql.TypesSQLException - because not supportedpublic String getParameterTypeName(int idx) throws SQLException
getParameterTypeName in interface ParameterMetaDataidx - the first parameter is 1, the second is 2, ...SQLException - if wrong indexpublic String getParameterClassName(int idx) throws SQLException
PreparedStatement.setObject.getParameterClassName in interface ParameterMetaDataidx - 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 wrong indexpublic int getParameterMode(int idx)
throws SQLException
getParameterMode in interface ParameterMetaDataidx - the first parameter is 1, the second is 2, ...ParameterMetaData.parameterModeIn,
ParameterMetaData.parameterModeOut, or ParameterMetaData.parameterModeInOut
ParameterMetaData.parameterModeUnknown.SQLExceptionpublic <T> T unwrap(Class<T> iface) throws SQLException
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.
unwrap in interface Wrapperiface - A Class defining an interface that the result must implement.SQLException - If no object found that implements the interfacepublic boolean isWrapperFor(Class<?> iface)
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.isWrapperFor in interface Wrapperiface - a Class defining an interface.Copyright © 2022 SingleStore. All rights reserved.