Package org.apache.derby.iapi.error
Class ExceptionUtil
java.lang.Object
org.apache.derby.iapi.error.ExceptionUtil
This class provides utility routines for exceptions
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic String
Dumps stack traces for all the threads if the JVM supports it.static int
getSeverityFromIdentifier
(String messageID) Get the severity given a message identifier fromSQLState
.static String
getSQLStateFromIdentifier
(String messageID) Convert a message identifier from org.apache.derby.shared.common.reference.SQLState to a SQLState five character string.static boolean
Determine if the givenSQLState
string constant is a deferred constraint transactional error.
-
Constructor Details
-
ExceptionUtil
public ExceptionUtil()
-
-
Method Details
-
getSQLStateFromIdentifier
Convert a message identifier from org.apache.derby.shared.common.reference.SQLState to a SQLState five character string.- Parameters:
messageID
- - the sql state id of the message from Derby- Returns:
- String - the 5 character code of the SQLState ID to returned to the user
-
getSeverityFromIdentifier
Get the severity given a message identifier fromSQLState
.- Parameters:
messageID
- the string carrying the SQL state- Returns:
- the constant representing the severity, as defined in
ExceptionSeverity
.
-
dumpThreads
Dumps stack traces for all the threads if the JVM supports it. The result is returned as a string, ready to print. If the JVM doesn't have the method Thread.getAllStackTraces i.e, we are on a JVM < 1.5, or if we don't have the permissions: java.lang.RuntimePermission "getStackTrace" and "modifyThreadGroup", a message saying so is returned instead.- Returns:
- stack traces for all live threads as a string or an error message.
-
isDeferredConstraintViolation
Determine if the givenSQLState
string constant is a deferred constraint transactional error. If this is so, returntrue
, else returnfalse
.- Parameters:
e
- the string with the SQL state- Returns:
- see method description
-