|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.hsqldb.jdbc.JDBCParameterMetaData
public class JDBCParameterMetaData
An object that can be used to get information about the types
and properties for each parameter marker in a
PreparedStatement
object. (JDBC4 Clarification:) 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.
Field Summary |
---|
Fields inherited from interface java.sql.ParameterMetaData |
---|
parameterModeIn, parameterModeInOut, parameterModeOut, parameterModeUnknown, parameterNoNulls, parameterNullable, parameterNullableUnknown |
Method Summary | ||
---|---|---|
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. |
|
String |
toString()
Retrieves a String repsentation of this object. |
|
|
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. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Method Detail |
---|
public int getParameterCount() throws SQLException
PreparedStatement
object for which this ParameterMetaData
object contains
information.
getParameterCount
in interface ParameterMetaData
SQLException
- if a database access error occurspublic int isNullable(int param) throws SQLException
isNullable
in interface ParameterMetaData
param
- the first parameter is 1, the second is 2, ...
ParameterMetaData.parameterNoNulls
,
ParameterMetaData.parameterNullable
, or
ParameterMetaData.parameterNullableUnknown
SQLException
- if a database access error occurspublic boolean isSigned(int param) throws SQLException
isSigned
in interface ParameterMetaData
param
- the first parameter is 1, the second is 2, ...
true
if so; false
otherwise
SQLException
- if a database access error occurspublic int getPrecision(int param) 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 ParameterMetaData
param
- the first parameter is 1, the second is 2, ...
SQLException
- if a database access error occurspublic int getScale(int param) throws SQLException
getScale
in interface ParameterMetaData
param
- 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 ParameterMetaData
param
- the first parameter is 1, the second is 2, ...
java.sql.Types
SQLException
- if a database access error occursTypes
public String getParameterTypeName(int param) throws SQLException
getParameterTypeName
in interface ParameterMetaData
param
- the first parameter is 1, the second is 2, ...
SQLException
- if a database access error occurspublic String getParameterClassName(int param) throws SQLException
PreparedStatement.setObject
.
getParameterClassName
in interface ParameterMetaData
param
- 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 getParameterMode(int param) throws SQLException
getParameterMode
in interface ParameterMetaData
param
- 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 <T> T unwrap(Class<T> iface) throws SQLException
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 Wrapper
iface
- A Class defining an interface that the result must implement.
SQLException
- If no object found that implements the interfacepublic boolean isWrapperFor(Class<?> iface) throws SQLException
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 Wrapper
iface
- 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 String toString()
toString
in class Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |