Enum SQLStateException

    • Method Detail

      • values

        public static SQLStateException[] values()
        Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
        for (SQLStateException c : SQLStateException.values())
            System.out.println(c);
        
        Returns:
        an array containing the constants of this enum type, in the order they are declared
      • valueOf

        public static SQLStateException valueOf​(String name)
        Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)
        Parameters:
        name - the name of the enum constant to be returned.
        Returns:
        the enum constant with the specified name
        Throws:
        IllegalArgumentException - if this enum type has no constant with the specified name
        NullPointerException - if the argument is null
      • getStateClass

        public String getStateClass()
        getValue() Returns the two character string corresponding to this SQLState/Exception map
        Returns:
        Two character string
      • getFullState

        public String getFullState()
      • fromState

        public static SQLStateException fromState​(String state)
        getEnum() Get the SQLStateException enum corresponding to the full
        Parameters:
        state - the full state code
        Returns:
        SQLStateException enum
      • fromStateClass

        public static SQLStateException fromStateClass​(String stateClass)
        getEnum() Get the SQLStateException enum corresponding to the two character string.
        Parameters:
        stateClass - Two characters representing the class of the SQLState
        Returns:
        SQLStateException enum
      • createDefault

        public SQLException createDefault​(String message,
                                          String state,
                                          int code)
        Creates generic SQLException
        Parameters:
        message - Message to include in exception
        state - sql state
        code - error code
      • raise

        public void raise​(String message,
                          String state,
                          int code)
                   throws SQLException
        Creates the appropriate SQLException
        Parameters:
        message - message to include in exception
        state - sql state
        code - error code
        Throws:
        SQLException