Package com.nuodb.jdbc
Enum SQLStateException
- java.lang.Object
-
- java.lang.Enum<SQLStateException>
-
- com.nuodb.jdbc.SQLStateException
-
- All Implemented Interfaces:
Serializable,Comparable<SQLStateException>
public enum SQLStateException extends Enum<SQLStateException>
Maps Standard SQL SQLState codes to the JDBC exception that should be thrown.
-
-
Enum Constant Summary
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract SQLExceptioncreate(String message, String state, int code)SQLExceptioncreateDefault(String message, String state, int code)Creates generic SQLExceptionstatic SQLStateExceptionfromState(String state)getEnum() Get the SQLStateException enum corresponding to the fullstatic SQLStateExceptionfromStateClass(String stateClass)getEnum() Get the SQLStateException enum corresponding to the two character string.StringgetFullState()StringgetStateClass()getValue() Returns the two character string corresponding to this SQLState/Exception mapvoidraise(String message, String state, int code)Creates the appropriate SQLExceptionstatic SQLStateExceptionvalueOf(String name)Returns the enum constant of this type with the specified name.static SQLStateException[]values()Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
SQL_SUCCESS
public static final SQLStateException SQL_SUCCESS
-
SQL_WARNING
public static final SQLStateException SQL_WARNING
-
SQL_CONNECTION_ERROR
public static final SQLStateException SQL_CONNECTION_ERROR
-
SQL_TRANSACTION_STATE_UNKNOWN
public static final SQLStateException SQL_TRANSACTION_STATE_UNKNOWN
-
SQL_FEATURE_NOT_SUPPORTED
public static final SQLStateException SQL_FEATURE_NOT_SUPPORTED
-
SQL_DATA
public static final SQLStateException SQL_DATA
-
SQL_INTEGRITY_CONSTRAINT_VALIDATION
public static final SQLStateException SQL_INTEGRITY_CONSTRAINT_VALIDATION
-
SQL_INVALID_AUTHORIZATION
public static final SQLStateException SQL_INVALID_AUTHORIZATION
-
SQL_TRANSIENT_ROLLBACK
public static final SQLStateException SQL_TRANSIENT_ROLLBACK
-
SQL_SYNTAX_ERROR
public static final SQLStateException SQL_SYNTAX_ERROR
-
SQL_SYSTEM_ERROR
public static final SQLStateException SQL_SYSTEM_ERROR
-
SQL_ODBC_ERROR
public static final SQLStateException SQL_ODBC_ERROR
-
SQL_UNKNOWN_EXCEPTION
public static final SQLStateException SQL_UNKNOWN_EXCEPTION
-
-
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 nameNullPointerException- 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 exceptionstate- sql statecode- error code
-
create
public abstract SQLException create(String message, String state, int code)
-
raise
public void raise(String message, String state, int code) throws SQLException
Creates the appropriate SQLException- Parameters:
message- message to include in exceptionstate- sql statecode- error code- Throws:
SQLException
-
-