Home » db-derby-10.5.3.0 » org.apache.derby.iapi.error » [javadoc | source]
org.apache.derby.iapi.error
public class: StandardException [javadoc | source]
java.lang.Object
   java.lang.Throwable
      java.lang.Exception
         org.apache.derby.iapi.error.StandardException

All Implemented Interfaces:
    java$io$Serializable

Direct Known Subclasses:
    LongColumnException, NoSpaceOnPage

StandardException is the root of all exceptions that are handled in a standard fashion by the database code, mainly in the language code.

This class is abstract to ensure that an implementation only throws a specific exception (e.g. TransactionException) which is a sub-class

A method in an iterface in a protocol under com.ibm.db2j.protocol.Database must only throw a StandardException (if it needs to throw an exception). This indicates that the method can throw an exception and therefore its caller must ensure that any resources it allocates will be cleaned up in the event of an exception in the StandardException hierarchy.

Implementations of methods that throw StandardException can have throws clause that are more specific than StandardException.
Nested Class Summary:
public static class  StandardException.BadMessageArgumentException  Dummy exception to catch incorrect use of StandardException.newException(), at compile-time. If you get a compilation error because this exception isn't caught, it means that you are using StandardException.newException(...) incorrectly. The nested exception should always be the second argument. 
Field Summary
public static final  int REPORT_DEFAULT     
public static final  int REPORT_NEVER     
public static final  int REPORT_ALWAYS     
Fields inherited from java.lang.Exception:
serialVersionUID
Constructor:
 protected StandardException(String messageID) 
 protected StandardException(String messageID,
    Object[] args) 
 protected StandardException(String messageID,
    Throwable t,
    Object[] args) 
Method from org.apache.derby.iapi.error.StandardException Summary:
closeException,   getArgumentFerry,   getArguments,   getErrorCode,   getErrorProperty,   getMessage,   getMessageId,   getSQLState,   getSQLStateFromIdentifier,   getSeverity,   getSeverityFromIdentifier,   interrupt,   newException,   newException,   newException,   newException,   newException,   newException,   newException,   newException,   newException,   newException,   newException,   newException,   newException,   newException,   newException,   newException,   newException,   newException,   newException,   newException,   newException,   newPreLocalizedException,   newWarning,   newWarning,   newWarning,   normalClose,   plainWrapException,   report,   setReport,   setSeverity,   toString,   unexpectedUserException
Methods from java.lang.Throwable:
fillInStackTrace,   getCause,   getLocalizedMessage,   getMessage,   getStackTrace,   initCause,   printStackTrace,   printStackTrace,   printStackTrace,   setStackTrace,   toString
Methods from java.lang.Object:
clone,   equals,   finalize,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
Method from org.apache.derby.iapi.error.StandardException Detail:
 public static StandardException closeException() 
    A special exception to close a session.
 public static SQLException getArgumentFerry(SQLException se) 
    Unpack the exception, looking for an DerbySQLException, which carries the Derby messageID and arguments.
 public final Object[] getArguments() 
    Returns the arguments for this exception, if there are any.
 public final int getErrorCode() 
 public String getErrorProperty(String type) 
    Get the error code for an error given a type. The value of the property messageId.type will be returned, e.g. deadlock.sqlstate.
 public String getMessage() 
    The message stored in the super class Throwable must be set up object creation. At this time we cannot get any information about the object itself (ie. this) in order to determine the natural language message. Ie. we need to class of the objec in order to look up its message, but we can't get the class of the exception before calling the super class message.

    Thus the message stored by Throwable and obtained by the getMessage() of Throwable (ie. super.getMessage() in this class) is the message identifier. The actual text message is stored in this class at the first request.

 public final String getMessageId() 
    Return the message identifier that is used to look up the error message text in the messages.properties file.
 public final String getSQLState() 
    Return the 5 character SQL State. If you need teh identifier that was used to create the message, then use getMessageId(). getMessageId() will return the string that corresponds to the field in org.apache.derby.iapi.reference.SQLState.
 public static String getSQLStateFromIdentifier(String messageID) 
    Convert a message identifer from org.apache.derby.iapi.reference.SQLState to a SQLState five character string.
 public final int getSeverity() 
 public static int getSeverityFromIdentifier(String messageID) 
    Get the severity given a message identifier from org.apache.derby.iapi.reference.SQLState.
 public static StandardException interrupt(InterruptedException ie) 
 public static StandardException newException(String messageID) 
 public static StandardException newException(String messageID,
    Throwable t) 
 public static StandardException newException(String messageID,
    Object a1) 
 public static StandardException newException(String messageID,
    Object[] a1) 
 public static StandardException newException(String messageID,
    Throwable t,
    Object a1) 
 public static StandardException newException(String messageID,
    Object a1,
    Object a2) 
 public static StandardException newException(String messageID,
    Object a1,
    Throwable t) throws BadMessageArgumentException 
    Dummy overload which should never be called. Only used to detect incorrect usage, at compile time.
 public static StandardException newException(String messageID,
    Throwable t,
    Object a1,
    Object a2) 
 public static StandardException newException(String messageID,
    Object a1,
    Object a2,
    Object a3) 
 public static StandardException newException(String messageID,
    Object a1,
    Object a2,
    Throwable t) throws BadMessageArgumentException 
    Dummy overload which should never be called. Only used to detect incorrect usage, at compile time.
 public static StandardException newException(String messageID,
    Throwable t,
    Object a1,
    Object a2,
    Object a3) 
 public static StandardException newException(String messageID,
    Object a1,
    Object a2,
    Object a3,
    Object a4) 
 public static StandardException newException(String messageID,
    Throwable t,
    Object a1,
    Object a2,
    Object a3,
    Object a4) 
 public static StandardException newException(String messageID,
    Object a1,
    Object a2,
    Object a3,
    Object a4,
    Object a5) 
 public static StandardException newException(String messageID,
    Throwable t,
    Object a1,
    Object a2,
    Object a3,
    Object a4,
    Object a5) 
 public static StandardException newException(String messageID,
    Object a1,
    Object a2,
    Object a3,
    Object a4,
    Object a5,
    Object a6) 
 public static StandardException newException(String messageID,
    Throwable t,
    Object a1,
    Object a2,
    Object a3,
    Object a4,
    Object a5,
    Object a6) 
 public static StandardException newException(String messageID,
    Object a1,
    Object a2,
    Object a3,
    Object a4,
    Object a5,
    Object a6,
    Object a7) 
 public static StandardException newException(String messageID,
    Throwable t,
    Object a1,
    Object a2,
    Object a3,
    Object a4,
    Object a5,
    Object a6,
    Object a7) 
 public static StandardException newException(String messageID,
    Object a1,
    Object a2,
    Object a3,
    Object a4,
    Object a5,
    Object a6,
    Object a7,
    Object a8) 
 public static StandardException newException(String messageID,
    Throwable t,
    Object a1,
    Object a2,
    Object a3,
    Object a4,
    Object a5,
    Object a6,
    Object a7,
    Object a8) 
 public static StandardException newPreLocalizedException(String MessageID,
    Throwable t,
    String localizedMessage) 
    Creates a new StandardException using message text that has already been localized.
 public static SQLWarning newWarning(String messageId) 
 public static SQLWarning newWarning(String messageId,
    Object a1) 
 public static SQLWarning newWarning(String messageId,
    Object a1,
    Object a2) 
 public static StandardException normalClose() 
 public static StandardException plainWrapException(Throwable t) 
    Similar to unexpectedUserException but makes no assumtion about when the execption is being called. The error is wrapped as simply as possible.
 public final int report() 
    Yes, report me. Errors that need this method to return false are in the minority.
 public final  void setReport(int report) 
    Set my report type.
 public final  void setSeverity(int severity) 
 public String toString() 
    Don't print the class name in the toString() method.
 public static StandardException unexpectedUserException(Throwable t)