Package org.h2.jdbc

Class JdbcParameterMetaData

java.lang.Object
org.h2.message.TraceObject
org.h2.jdbc.JdbcParameterMetaData
All Implemented Interfaces:
ParameterMetaData, Wrapper

public final class JdbcParameterMetaData extends org.h2.message.TraceObject implements ParameterMetaData
Information about the parameters of a prepared statement.
  • Method Details

    • getParameterCount

      public int getParameterCount() throws SQLException
      Returns the number of parameters.
      Specified by:
      getParameterCount in interface ParameterMetaData
      Returns:
      the number
      Throws:
      SQLException
    • getParameterMode

      public int getParameterMode(int param) throws SQLException
      Returns the parameter mode. Always returns parameterModeIn.
      Specified by:
      getParameterMode in interface ParameterMetaData
      Parameters:
      param - the column index (1,2,...)
      Returns:
      parameterModeIn
      Throws:
      SQLException
    • getParameterType

      public int getParameterType(int param) throws SQLException
      Returns the parameter type. java.sql.Types.VARCHAR is returned if the data type is not known.
      Specified by:
      getParameterType in interface ParameterMetaData
      Parameters:
      param - the column index (1,2,...)
      Returns:
      the data type
      Throws:
      SQLException
    • getPrecision

      public int getPrecision(int param) throws SQLException
      Returns the parameter precision. The value 0 is returned if the precision is not known.
      Specified by:
      getPrecision in interface ParameterMetaData
      Parameters:
      param - the column index (1,2,...)
      Returns:
      the precision
      Throws:
      SQLException
    • getScale

      public int getScale(int param) throws SQLException
      Returns the parameter scale. The value 0 is returned if the scale is not known.
      Specified by:
      getScale in interface ParameterMetaData
      Parameters:
      param - the column index (1,2,...)
      Returns:
      the scale
      Throws:
      SQLException
    • isNullable

      public int isNullable(int param) throws SQLException
      Checks if this is nullable parameter. Returns ResultSetMetaData.columnNullableUnknown..
      Specified by:
      isNullable in interface ParameterMetaData
      Parameters:
      param - the column index (1,2,...)
      Returns:
      ResultSetMetaData.columnNullableUnknown
      Throws:
      SQLException
    • isSigned

      public boolean isSigned(int param) throws SQLException
      Checks if this parameter is signed. It always returns true.
      Specified by:
      isSigned in interface ParameterMetaData
      Parameters:
      param - the column index (1,2,...)
      Returns:
      true
      Throws:
      SQLException
    • getParameterClassName

      public String getParameterClassName(int param) throws SQLException
      Returns the Java class name of the parameter. "java.lang.String" is returned if the type is not known.
      Specified by:
      getParameterClassName in interface ParameterMetaData
      Parameters:
      param - the column index (1,2,...)
      Returns:
      the Java class name
      Throws:
      SQLException
    • getParameterTypeName

      public String getParameterTypeName(int param) throws SQLException
      Returns the parameter type name. "VARCHAR" is returned if the type is not known.
      Specified by:
      getParameterTypeName in interface ParameterMetaData
      Parameters:
      param - the column index (1,2,...)
      Returns:
      the type name
      Throws:
      SQLException
    • unwrap

      public <T> T unwrap(Class<T> iface) throws SQLException
      Return an object of this class if possible.
      Specified by:
      unwrap in interface Wrapper
      Parameters:
      iface - the class
      Returns:
      this
      Throws:
      SQLException
    • isWrapperFor

      public boolean isWrapperFor(Class<?> iface) throws SQLException
      Checks if unwrap can return an object of this class.
      Specified by:
      isWrapperFor in interface Wrapper
      Parameters:
      iface - the class
      Returns:
      whether or not the interface is assignable from this class
      Throws:
      SQLException
    • toString

      public String toString()
      INTERNAL
      Overrides:
      toString in class Object