Class SQLStates


  • public class SQLStates
    extends Object
    Utility class containing 1) SQL state constants used to represent JDBC error state code, and 2) utility methods to check whether a SQL state belongs to a particular class of exception states.
    Since:
    4.3
    • Field Detail

      • CLASS_CONNECTION_EXCEPTION

        public static final SQLStates.SQLStateClass CLASS_CONNECTION_EXCEPTION
        Identifies the SQLState class Connection Exception (08).
      • CONNECTION_EXCEPTION_NO_SUBCLASS

        public static final String CONNECTION_EXCEPTION_NO_SUBCLASS
        Connection Exception with no subclass (SQL-99 08000)
        See Also:
        Constant Field Values
      • CONNECTION_EXCEPTION_SQLCLIENT_UNABLE_TO_ESTABLISH_SQLCONNECTION

        public static final String CONNECTION_EXCEPTION_SQLCLIENT_UNABLE_TO_ESTABLISH_SQLCONNECTION
        SQL-client unable to establish SQL-connection (SQL-99 08001)
        See Also:
        Constant Field Values
      • CONNECTION_EXCEPTION_CONNECTION_NAME_IN_USE

        public static final String CONNECTION_EXCEPTION_CONNECTION_NAME_IN_USE
        Connection name in use (SQL-99 08002)
        See Also:
        Constant Field Values
      • CONNECTION_EXCEPTION_CONNECTION_DOES_NOT_EXIST

        public static final String CONNECTION_EXCEPTION_CONNECTION_DOES_NOT_EXIST
        Connection does not exist (SQL-99 08003)
        See Also:
        Constant Field Values
      • CONNECTION_EXCEPTION_SQLSERVER_REJECTED_ESTABLISHMENT_OF_SQLCONNECTION

        public static final String CONNECTION_EXCEPTION_SQLSERVER_REJECTED_ESTABLISHMENT_OF_SQLCONNECTION
        SQL-server rejected establishment of SQL-connection (SQL-99 08004)
        See Also:
        Constant Field Values
      • CONNECTION_EXCEPTION_CONNECTION_FAILURE

        public static final String CONNECTION_EXCEPTION_CONNECTION_FAILURE
        Connection failure (SQL-99 08006)
        See Also:
        Constant Field Values
      • CONNECTION_EXCEPTION_TRANSACTION_RESOLUTION_UNKNOWN

        public static final String CONNECTION_EXCEPTION_TRANSACTION_RESOLUTION_UNKNOWN
        Transaction resolution unknown (SQL-99 08007)
        See Also:
        Constant Field Values
      • CONNECTION_EXCEPTION_STALE_CONNECTION

        public static final String CONNECTION_EXCEPTION_STALE_CONNECTION
        Connection is stale and should no longer be used. (08S01)

        The SQLState subclass S01 is an implementation-specified condition and conforms to the subclass DataDirect uses for SocketExceptions.

        See Also:
        Constant Field Values
      • CLASS_INVALID_AUTHORIZATION_SPECIFICATION

        public static final SQLStates.SQLStateClass CLASS_INVALID_AUTHORIZATION_SPECIFICATION
        Identifies the SQLState class Invalid Authorization Specification (28).
      • INVALID_AUTHORIZATION_SPECIFICATION_NO_SUBCLASS

        public static final String INVALID_AUTHORIZATION_SPECIFICATION_NO_SUBCLASS
        Invalid authorization specification with no subclass (SQL-99 28000)
        See Also:
        Constant Field Values
      • DEFAULT

        public static final String DEFAULT
        External routine exception. This is the default unknown code
        See Also:
        Constant Field Values
      • VIRTUAL_PROCEDURE_ERROR

        public static final String VIRTUAL_PROCEDURE_ERROR
        Error raised by ERROR instruction in virtual procedure.
        See Also:
        Constant Field Values
    • Constructor Detail

      • SQLStates

        public SQLStates()
    • Method Detail

      • isSystemErrorState

        public static boolean isSystemErrorState​(String sqlStateCode)
      • isUsageErrorState

        public static boolean isUsageErrorState​(String sqlStateCode)