Package org.h2.jdbc
Class JdbcParameterMetaData
- java.lang.Object
-
- org.h2.message.TraceObject
-
- org.h2.jdbc.JdbcParameterMetaData
-
- All Implemented Interfaces:
java.sql.ParameterMetaData,java.sql.Wrapper
public final class JdbcParameterMetaData extends TraceObject implements java.sql.ParameterMetaData
Information about the parameters of a prepared statement.
-
-
Field Summary
Fields Modifier and Type Field Description private intparamCountprivate java.util.ArrayList<? extends ParameterInterface>parametersprivate JdbcPreparedStatementprep-
Fields inherited from class org.h2.message.TraceObject
ARRAY, BLOB, CALLABLE_STATEMENT, CLOB, CONNECTION, DATA_SOURCE, DATABASE_META_DATA, PARAMETER_META_DATA, PREPARED_STATEMENT, RESULT_SET, RESULT_SET_META_DATA, SAVEPOINT, SQLXML, STATEMENT, trace, XA_DATA_SOURCE, XID
-
-
Constructor Summary
Constructors Constructor Description JdbcParameterMetaData(Trace trace, JdbcPreparedStatement prep, CommandInterface command, int id)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private voidcheckClosed()private ParameterInterfacegetParameter(int param)java.lang.StringgetParameterClassName(int param)Returns the Java class name of the parameter.intgetParameterCount()Returns the number of parameters.intgetParameterMode(int param)Returns the parameter mode.intgetParameterType(int param)Returns the parameter type.java.lang.StringgetParameterTypeName(int param)Returns the parameter type name.intgetPrecision(int param)Returns the parameter precision.intgetScale(int param)Returns the parameter scale.intisNullable(int param)Checks if this is nullable parameter.booleanisSigned(int param)Checks if this parameter is signed.booleanisWrapperFor(java.lang.Class<?> iface)Checks if unwrap can return an object of this class.java.lang.StringtoString()INTERNAL<T> Tunwrap(java.lang.Class<T> iface)Return an object of this class if possible.-
Methods inherited from class org.h2.message.TraceObject
debugCode, debugCodeAssign, debugCodeCall, debugCodeCall, debugCodeCall, getNextId, getTraceId, getTraceObjectName, isDebugEnabled, isInfoEnabled, logAndConvert, quote, quoteArray, quoteBigDecimal, quoteBytes, quoteDate, quoteIntArray, quoteMap, quoteTime, quoteTimestamp, setTrace, unsupported
-
-
-
-
Field Detail
-
prep
private final JdbcPreparedStatement prep
-
paramCount
private final int paramCount
-
parameters
private final java.util.ArrayList<? extends ParameterInterface> parameters
-
-
Constructor Detail
-
JdbcParameterMetaData
JdbcParameterMetaData(Trace trace, JdbcPreparedStatement prep, CommandInterface command, int id)
-
-
Method Detail
-
getParameterCount
public int getParameterCount() throws java.sql.SQLExceptionReturns the number of parameters.- Specified by:
getParameterCountin interfacejava.sql.ParameterMetaData- Returns:
- the number
- Throws:
java.sql.SQLException
-
getParameterMode
public int getParameterMode(int param) throws java.sql.SQLExceptionReturns the parameter mode. Always returns parameterModeIn.- Specified by:
getParameterModein interfacejava.sql.ParameterMetaData- Parameters:
param- the column index (1,2,...)- Returns:
- parameterModeIn
- Throws:
java.sql.SQLException
-
getParameterType
public int getParameterType(int param) throws java.sql.SQLExceptionReturns the parameter type. java.sql.Types.VARCHAR is returned if the data type is not known.- Specified by:
getParameterTypein interfacejava.sql.ParameterMetaData- Parameters:
param- the column index (1,2,...)- Returns:
- the data type
- Throws:
java.sql.SQLException
-
getPrecision
public int getPrecision(int param) throws java.sql.SQLExceptionReturns the parameter precision. The value 0 is returned if the precision is not known.- Specified by:
getPrecisionin interfacejava.sql.ParameterMetaData- Parameters:
param- the column index (1,2,...)- Returns:
- the precision
- Throws:
java.sql.SQLException
-
getScale
public int getScale(int param) throws java.sql.SQLExceptionReturns the parameter scale. The value 0 is returned if the scale is not known.- Specified by:
getScalein interfacejava.sql.ParameterMetaData- Parameters:
param- the column index (1,2,...)- Returns:
- the scale
- Throws:
java.sql.SQLException
-
isNullable
public int isNullable(int param) throws java.sql.SQLExceptionChecks if this is nullable parameter. Returns ResultSetMetaData.columnNullableUnknown..- Specified by:
isNullablein interfacejava.sql.ParameterMetaData- Parameters:
param- the column index (1,2,...)- Returns:
- ResultSetMetaData.columnNullableUnknown
- Throws:
java.sql.SQLException
-
isSigned
public boolean isSigned(int param) throws java.sql.SQLExceptionChecks if this parameter is signed. It always returns true.- Specified by:
isSignedin interfacejava.sql.ParameterMetaData- Parameters:
param- the column index (1,2,...)- Returns:
- true
- Throws:
java.sql.SQLException
-
getParameterClassName
public java.lang.String getParameterClassName(int param) throws java.sql.SQLExceptionReturns the Java class name of the parameter. "java.lang.String" is returned if the type is not known.- Specified by:
getParameterClassNamein interfacejava.sql.ParameterMetaData- Parameters:
param- the column index (1,2,...)- Returns:
- the Java class name
- Throws:
java.sql.SQLException
-
getParameterTypeName
public java.lang.String getParameterTypeName(int param) throws java.sql.SQLExceptionReturns the parameter type name. "VARCHAR" is returned if the type is not known.- Specified by:
getParameterTypeNamein interfacejava.sql.ParameterMetaData- Parameters:
param- the column index (1,2,...)- Returns:
- the type name
- Throws:
java.sql.SQLException
-
getParameter
private ParameterInterface getParameter(int param)
-
checkClosed
private void checkClosed()
-
unwrap
public <T> T unwrap(java.lang.Class<T> iface) throws java.sql.SQLExceptionReturn an object of this class if possible.- Specified by:
unwrapin interfacejava.sql.Wrapper- Parameters:
iface- the class- Returns:
- this
- Throws:
java.sql.SQLException
-
isWrapperFor
public boolean isWrapperFor(java.lang.Class<?> iface) throws java.sql.SQLExceptionChecks if unwrap can return an object of this class.- Specified by:
isWrapperForin interfacejava.sql.Wrapper- Parameters:
iface- the class- Returns:
- whether or not the interface is assignable from this class
- Throws:
java.sql.SQLException
-
toString
public java.lang.String toString()
INTERNAL- Overrides:
toStringin classjava.lang.Object
-
-