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.
| Modifier and Type | Class and Description |
|---|---|
| public static class | StandardException.BadMessageArgumentException
Dummy exception to catch incorrect use of StandardException.newException(), at compile-time. |
| Modifier and Type | Field and Description |
|---|---|
| private transient Object[] | |
| private transient boolean | |
| private transient SQLException | |
| private transient int | |
| public static final int | |
| public static final int | |
| public static final int | |
| private int | |
| private String | |
| private String |
| Access | Constructor and Description |
|---|---|
| protected | |
| protected | |
| private | StandardException(String
the sql state of the message sqlState, String the text of the message text)This constructor is used when we already have the message text. |
| Modifier and Type | Method and Description |
|---|---|
| public static StandardException | |
| public static StandardException | Returns: a Derby exception wrapping the contents of the SQLExceptionA SQLException se)Unpack the exception, looking for a StandardException, which carries the Derby messageID and arguments. |
| public final Object[] | |
| public final int | |
| public String | Returns: the corresponding error codeAn error type type)Get the error code for an error given a type. |
| private static String | |
| public String | Returns: the message textOverrides java. The message stored in the super class Throwable must be set up object creation. |
| public final String | Returns: the message idReturn the message identifier that is used to look up the error message text in the messages.properties file. |
| public final SQLException | Returns: the next exceptionGet the next |
| public final int | |
| public static int | Returns: the severity associated with the messageThe handle on the message messageID)Get the severity given a message identifier from org.apache.derby.shared.common.reference.SQLState. |
| public final String | |
| public static String | Returns: String - the 5 character code of the SQLState ID to returned to the user- the sql state id of the message from Derby messageID)Convert a message identifer from org.apache.derby.shared.common.reference.SQLState to a SQLState five character string. |
| public static StandardException | |
| public final boolean | |
| public final boolean | Returns: true if this exception is a lock timeout or lock deadlock.Is this a lock timeout or lock deadlock exception. |
| public final boolean | Returns: true if this exception is a self-deadlock.Is this a self-deadlock exception caused by a nested transaction being blocked by its parent's locks. |
| private static boolean | Returns: true if the throwable is a vacuous wrapper and the
only useful piece of information is the cause, or false
otherwisethe throwable to check t)Check if the top-level throwable is just a vacuous wrapper that does
not carry any useful information except what's returned by the
|
| pack-priv final void | |
| public static StandardException | |
| public static StandardException | |
| public static StandardException | Returns: nothing - always throws- the sql state id of the message messageID, Object - Message arg a1, Throwable - Incorrectly placed exception to be nested t)Dummy overload which should never be called. |
| public static StandardException | Returns: nothing - always throws- the sql state id of the message messageID, Object - First message arg a1, Object - Second message arg a2, Throwable - Incorrectly placed exception to be nested t)Dummy overload which should never be called. |
| public static StandardException | Returns: a Derby exceptionThe SQLState and severity are derived from the ID. However the text message is not. MessageID, Throwable The Throwable that caused this exception, null if this exception was not caused by another Throwable. t, String The message associated with this exception.
It is the caller's responsibility to ensure that this message is properly localized.
See org.apache.derby.iapi.tools.i18n.LocalizedResource localizedMessage)Creates a new StandardException using message text that has already been localized. |
| public static SQLWarning | |
| public static StandardException | |
| public static StandardException | Returns: a Derby exception which wraps the original errorThe original error which should be wrapped t)Similar to unexpectedUserException but makes no assumtion about when the execption is being called. |
| public final int | |
| public final void | |
| public final void | |
| public String | toString()
Overrides java. |
| public static StandardException |
| arguments | back to summary |
|---|---|
| private transient Object[] arguments | |
| isForPublicAPI | back to summary |
|---|---|
| private transient boolean isForPublicAPI | |
| next | back to summary |
|---|---|
| private transient SQLException next | |
| report | back to summary |
|---|---|
| private transient int report | |
| REPORT_ALWAYS | back to summary |
|---|---|
| public static final int REPORT_ALWAYS | |
| REPORT_DEFAULT | back to summary |
|---|---|
| public static final int REPORT_DEFAULT | |
| REPORT_NEVER | back to summary |
|---|---|
| public static final int REPORT_NEVER | |
| severity | back to summary |
|---|---|
| private int severity | |
| sqlState | back to summary |
|---|---|
| private String sqlState | |
| textMessage | back to summary |
|---|---|
| private String textMessage | |
| StandardException | back to summary |
|---|---|
| protected StandardException(String messageID) | |
| StandardException | back to summary |
|---|---|
| protected StandardException(String messageID, Throwable t, Object[] args) | |
| StandardException | back to summary |
|---|---|
| private StandardException(String sqlState, String text) This constructor is used when we already have the message text. | |
| closeException | back to summary |
|---|---|
| public static StandardException closeException() A special exception to close a session.
| |
| getArgumentFerry | back to summary |
|---|---|
| public static StandardException getArgumentFerry(SQLException se) Unpack the exception, looking for a StandardException, which carries the Derby messageID and arguments. See org.apache.derby.impl.jdbc.SQLExceptionFactory See org.apache.derby.impl.jdbc.Util
| |
| getArguments | back to summary |
|---|---|
| public final Object[] getArguments() | |
| getErrorCode | back to summary |
|---|---|
| public final int getErrorCode() | |
| getErrorProperty | back to summary |
|---|---|
| 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. | |
| getErrorProperty | back to summary |
|---|---|
| private static String getErrorProperty(String messageId, String type) | |
| getMessage | back to summary |
|---|---|
| public String getMessage() Overrides java. 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.
| |
| getMessageId | back to summary |
|---|---|
| public final String getMessageId() Return the message identifier that is used to look up the error message text in the messages.properties file.
| |
| getNextException | back to summary |
|---|---|
| public final SQLException getNextException() Get the next
| |
| getSeverity | back to summary |
|---|---|
| public final int getSeverity() | |
| getSeverityFromIdentifier | back to summary |
|---|---|
| public static int getSeverityFromIdentifier(String messageID) Get the severity given a message identifier from org.apache.derby.shared.common.reference.SQLState.
| |
| getSQLState | back to summary |
|---|---|
| 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.shared.common.reference.SQLState.
| |
| getSQLStateFromIdentifier | back to summary |
|---|---|
| public static String getSQLStateFromIdentifier(String messageID) Convert a message identifer from org.apache.derby.shared.common.reference.SQLState to a SQLState five character string. | |
| interrupt | back to summary |
|---|---|
| public static StandardException interrupt(InterruptedException ie) | |
| isLockTimeout | back to summary |
|---|---|
| public final boolean isLockTimeout() Is this a lock timeout exception.
| |
| isLockTimeoutOrDeadlock | back to summary |
|---|---|
| public final boolean isLockTimeoutOrDeadlock() Is this a lock timeout or lock deadlock exception.
| |
| isSelfDeadlock | back to summary |
|---|---|
| public final boolean isSelfDeadlock() Is this a self-deadlock exception caused by a nested transaction being blocked by its parent's locks.
| |
| isVacuousWrapper | back to summary |
|---|---|
| private static boolean isVacuousWrapper(Throwable t) Check if the top-level throwable is just a vacuous wrapper that does
not carry any useful information except what's returned by the
| |
| markAsPublicAPI | back to summary |
|---|---|
| pack-priv final void markAsPublicAPI() Mark this exception as one that is thrown by a public API method. The purpose is to signal that this should be a top-level exception, so that it doesn't get wrapped inside multiple layers of other SQLExceptions or StandardExceptions as it travels up through the code layers.
| |
| newException | back to summary |
|---|---|
| public static StandardException newException(String messageId, Object... args) | |
| newException | back to summary |
|---|---|
| public static StandardException newException(String messageId, Throwable t, Object... args) | |
| newException | back to summary |
|---|---|
| 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.
| |
| newException | back to summary |
|---|---|
| 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.
| |
| newPreLocalizedException | back to summary |
|---|---|
| public static StandardException newPreLocalizedException(String MessageID, Throwable t, String localizedMessage) Creates a new StandardException using message text that has already been localized.
| |
| newWarning | back to summary |
|---|---|
| public static SQLWarning newWarning(String messageId, Object... oa) | |
| normalClose | back to summary |
|---|---|
| public static StandardException normalClose() | |
| plainWrapException | back to summary |
|---|---|
| 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.
| |
| report | back to summary |
|---|---|
| public final int report() Yes, report me. Errors that need this method to return false are in the minority.
| |
| setReport | back to summary |
|---|---|
| public final void setReport(int report) Set my report type.
| |
| setSeverity | back to summary |
|---|---|
| public final void setSeverity(int severity) | |
| toString | back to summary |
|---|---|
| public String toString() Overrides java. Don't print the class name in the toString() method.
| |
| unexpectedUserException | back to summary |
|---|---|
| public static StandardException unexpectedUserException(Throwable t) | |