Class ExceptionUtil

java.lang.Object
org.apache.derby.iapi.error.ExceptionUtil

public class ExceptionUtil extends Object
This class provides utility routines for exceptions
  • Constructor Details

    • ExceptionUtil

      public ExceptionUtil()
  • Method Details

    • getSQLStateFromIdentifier

      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 - - 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

      public static int getSeverityFromIdentifier(String messageID)
      Get the severity given a message identifier from SQLState.
      Parameters:
      messageID - the string carrying the SQL state
      Returns:
      the constant representing the severity, as defined in ExceptionSeverity.
    • dumpThreads

      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:
      stack traces for all live threads as a string or an error message.
    • isDeferredConstraintViolation

      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 - the string with the SQL state
      Returns:
      see method description