Top Description Constructors Methods
org.apache.derby.shared.common.error

public Class ExceptionUtil

extends Object
Class Inheritance
Imports
java.io.PrintWriter, .StringWriter, java.lang.reflect.InvocationTargetException, .Method, org.apache.derby.shared.common.reference.SQLState, org.apache.derby.shared.common.error.ExceptionSeverity

This class provides utility routines for exceptions

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public static String

Returns:

stack traces for all live threads as a string or an error message.
dumpThreads
()

Dumps stack traces for all the threads if the JVM supports it.

public static int

Returns:

the constant representing the severity, as defined in org.apache.derby.shared.common.error.ExceptionSeverity.
getSeverityFromIdentifier
(String
the string carrying the SQL state
messageID
)

Get the severity given a message identifier from SQLState.

public static String

Returns:

String - the 5 character code of the SQLState ID to returned to the user
getSQLStateFromIdentifier
(String
- the sql state id of the message from Derby
messageID
)

Convert a message identifier from org.apache.derby.shared.common.reference.SQLState to a SQLState five character string.

public static boolean

Returns:

see method description
isDeferredConstraintViolation
(String
the string with the SQL state
e
)

Determine if the given SQLState string constant is a deferred constraint transactional error.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

ExceptionUtilback to summary
public ExceptionUtil()

Method Detail

dumpThreadsback to summary
public static String 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:String

stack traces for all live threads as a string or an error message.

getSeverityFromIdentifierback to summary
public static int getSeverityFromIdentifier(String messageID)

Get the severity given a message identifier from SQLState.

Parameters
messageID:String

the string carrying the SQL state

Returns:int

the constant representing the severity, as defined in org.apache.derby.shared.common.error.ExceptionSeverity.

getSQLStateFromIdentifierback to summary
public static String getSQLStateFromIdentifier(String messageID)

Convert a message identifier from org.apache.derby.shared.common.reference.SQLState to a SQLState five character string.

Parameters
messageID:String

- the sql state id of the message from Derby

Returns:String

String - the 5 character code of the SQLState ID to returned to the user

isDeferredConstraintViolationback to summary
public static boolean isDeferredConstraintViolation(String e)

Determine if the given SQLState string constant is a deferred constraint transactional error. If this is so, return true, else return false.

Parameters
e:String

the string with the SQL state

Returns:boolean

see method description