Class ErrorMessages

  • All Implemented Interfaces:
    java.lang.AutoCloseable, java.security.PrivilegedAction<java.io.InputStream>, java.sql.ResultSet, java.sql.Wrapper, AwareVTI, VTICosting

    public final class ErrorMessages
    extends VTITemplate
    implements VTICosting, java.security.PrivilegedAction<java.io.InputStream>
    ErrorMessage shows all the SQLStates, locale-sensitive error messages, and exception severities for a database.

    To use it, query it as follows:

     SELECT* FROM NEW org.apache.derby.diag.ErrorMessages() AS EQ; 

    The following columns will be returned:

    • SQL_STATE--VARCHAR(5) - nullable. The SQLState of the SQLException.
      (The code returned by getSQLState() in SQLException.)
    • MESSAGE--VARCHAR(32672) - nullable. The error message
      (The code returned by getMessage() in SQLException.)
    • SEVERITY--INTEGER - nullable. The Derby code for the severity.
      (The code returned by getErrorCode() in SQLException.)
    • Field Detail

      • p

        private java.util.Properties p
      • keys

        private java.util.Enumeration keys
      • k

        private java.lang.String k
      • SQLState

        private java.lang.String SQLState
      • message

        private java.lang.String message
      • severity

        private int severity
      • msgFile

        private int msgFile
      • metadata

        private static final java.sql.ResultSetMetaData metadata
    • Constructor Detail

      • ErrorMessages

        public ErrorMessages()
                      throws java.io.IOException
        Throws:
        java.io.IOException
    • Method Detail

      • next

        public boolean next()
        Specified by:
        next in interface java.sql.ResultSet
        See Also:
        ResultSet.next()
      • close

        public void close()
        Specified by:
        close in interface java.lang.AutoCloseable
        Specified by:
        close in interface java.sql.ResultSet
        See Also:
        ResultSet.close()
      • getMetaData

        public java.sql.ResultSetMetaData getMetaData()
        Specified by:
        getMetaData in interface java.sql.ResultSet
        Overrides:
        getMetaData in class VTITemplate
        See Also:
        ResultSet.getMetaData()
      • getString

        public java.lang.String getString​(int columnIndex)
                                   throws java.sql.SQLException
        Specified by:
        getString in interface java.sql.ResultSet
        Overrides:
        getString in class VTITemplate
        Throws:
        java.sql.SQLException - column at index is not found
        See Also:
        ResultSet.getString(int)
      • getInt

        public int getInt​(int columnIndex)
                   throws java.sql.SQLException
        Specified by:
        getInt in interface java.sql.ResultSet
        Overrides:
        getInt in class VTITemplate
        Throws:
        java.sql.SQLException - column at index is not found
        See Also:
        ResultSet.getInt(int)
      • loadProperties

        private void loadProperties()
                             throws java.io.IOException
        Throws:
        java.io.IOException
      • notAnException

        private boolean notAnException()
      • getEstimatedRowCount

        public double getEstimatedRowCount​(VTIEnvironment vtiEnvironment)
        Description copied from interface: VTICosting
        Get the estimated row count for a single scan of a Table Function.
        Specified by:
        getEstimatedRowCount in interface VTICosting
        Parameters:
        vtiEnvironment - The state variable for optimizing the Table Function.
        Returns:
        The estimated row count for a single scan of the Table Function.
      • getEstimatedCostPerInstantiation

        public double getEstimatedCostPerInstantiation​(VTIEnvironment vtiEnvironment)
        Description copied from interface: VTICosting
        Get the estimated cost for a single instantiation of a Table Function.
        Specified by:
        getEstimatedCostPerInstantiation in interface VTICosting
        Parameters:
        vtiEnvironment - The state variable for optimizing the Table Function.
        Returns:
        The estimated cost for a single instantiation of the Table Function.
      • supportsMultipleInstantiations

        public boolean supportsMultipleInstantiations​(VTIEnvironment vtiEnvironment)
        Description copied from interface: VTICosting
        Find out if the ResultSet of the Table Function can be instantiated multiple times.
        Specified by:
        supportsMultipleInstantiations in interface VTICosting
        Parameters:
        vtiEnvironment - The state variable for optimizing the Table Function.
        Returns:
        True if the ResultSet can be instantiated multiple times, false if can only be instantiated once.
      • run

        public final java.io.InputStream run()
        Specified by:
        run in interface java.security.PrivilegedAction<java.io.InputStream>