Package org.h2.jdbc

Class 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.
    • Method Detail

      • getParameterCount

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

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

        public int getParameterType​(int param)
                             throws java.sql.SQLException
        Returns the parameter type. java.sql.Types.VARCHAR is returned if the data type is not known.
        Specified by:
        getParameterType in interface java.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.SQLException
        Returns the parameter precision. The value 0 is returned if the precision is not known.
        Specified by:
        getPrecision in interface java.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.SQLException
        Returns the parameter scale. The value 0 is returned if the scale is not known.
        Specified by:
        getScale in interface java.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.SQLException
        Checks if this is nullable parameter. Returns ResultSetMetaData.columnNullableUnknown..
        Specified by:
        isNullable in interface java.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.SQLException
        Checks if this parameter is signed. It always returns true.
        Specified by:
        isSigned in interface java.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.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 java.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.SQLException
        Returns the parameter type name. "VARCHAR" is returned if the type is not known.
        Specified by:
        getParameterTypeName in interface java.sql.ParameterMetaData
        Parameters:
        param - the column index (1,2,...)
        Returns:
        the type name
        Throws:
        java.sql.SQLException
      • checkClosed

        private void checkClosed()
      • unwrap

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

        public boolean isWrapperFor​(java.lang.Class<?> iface)
                             throws java.sql.SQLException
        Checks if unwrap can return an object of this class.
        Specified by:
        isWrapperFor in interface java.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:
        toString in class java.lang.Object