Package org.teiid.jdbc
Class SQLStates
- java.lang.Object
-
- org.teiid.jdbc.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
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
SQLStates.SQLStateClass
-
Field Summary
Fields Modifier and Type Field Description static SQLStates.SQLStateClass
CLASS_CONNECTION_EXCEPTION
Identifies the SQLState class Connection Exception (08).static SQLStates.SQLStateClass
CLASS_INVALID_AUTHORIZATION_SPECIFICATION
Identifies the SQLState class Invalid Authorization Specification (28).static SQLStates.SQLStateClass
CLASS_USAGE_ERROR
static String
CONNECTION_EXCEPTION_CONNECTION_DOES_NOT_EXIST
Connection does not exist (SQL-99 08003)static String
CONNECTION_EXCEPTION_CONNECTION_FAILURE
Connection failure (SQL-99 08006)static String
CONNECTION_EXCEPTION_CONNECTION_NAME_IN_USE
Connection name in use (SQL-99 08002)static String
CONNECTION_EXCEPTION_NO_SUBCLASS
Connection Exception with no subclass (SQL-99 08000)static String
CONNECTION_EXCEPTION_SQLCLIENT_UNABLE_TO_ESTABLISH_SQLCONNECTION
SQL-client unable to establish SQL-connection (SQL-99 08001)static String
CONNECTION_EXCEPTION_SQLSERVER_REJECTED_ESTABLISHMENT_OF_SQLCONNECTION
SQL-server rejected establishment of SQL-connection (SQL-99 08004)static String
CONNECTION_EXCEPTION_STALE_CONNECTION
Connection is stale and should no longer be used.static String
CONNECTION_EXCEPTION_TRANSACTION_RESOLUTION_UNKNOWN
Transaction resolution unknown (SQL-99 08007)static String
DEFAULT
External routine exception.static String
INVALID_AUTHORIZATION_SPECIFICATION_NO_SUBCLASS
Invalid authorization specification with no subclass (SQL-99 28000)static String
QUERY_CANCELED
static String
SUCESS
static String
USAGE_ERROR
General query execution errorstatic String
VIRTUAL_PROCEDURE_ERROR
Error raised by ERROR instruction in virtual procedure.
-
Constructor Summary
Constructors Constructor Description SQLStates()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static boolean
belongsToClass(String sqlStateCode, SQLStates.SQLStateClass sqlStateClass)
static SQLStates.SQLStateClass
getClass(String sqlStateCode)
static boolean
isSystemErrorState(String sqlStateCode)
static boolean
isUsageErrorState(String sqlStateCode)
-
-
-
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
-
QUERY_CANCELED
public static final String QUERY_CANCELED
- 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
-
SUCESS
public static final String SUCESS
- See Also:
- Constant Field Values
-
CLASS_USAGE_ERROR
public static final SQLStates.SQLStateClass CLASS_USAGE_ERROR
-
USAGE_ERROR
public static final String USAGE_ERROR
General query execution error- 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
-
-
Method Detail
-
isSystemErrorState
public static boolean isSystemErrorState(String sqlStateCode)
-
isUsageErrorState
public static boolean isUsageErrorState(String sqlStateCode)
-
belongsToClass
public static boolean belongsToClass(String sqlStateCode, SQLStates.SQLStateClass sqlStateClass)
-
getClass
public static SQLStates.SQLStateClass getClass(String sqlStateCode)
-
-