public class OracleException
extends java.lang.Exception
OracleException
could
have a SQLException
as a cause).
Note: cause exceptions are subject to change in the future. Your application code should avoid relying on them.
Certain API operations might provide multiple exceptions. For example,
for the Oracle RDBMS implementation of SODA, insert statements might
generate multiple SQL exceptions wrapped in SODA exceptions. In
these cases, the additional exceptions are accessible via
getNextException()
. The exception returned by
getNextException()
might, in turn, have another exception
chained to it. Thus, in order to access all exceptions in the chain,
an application can recursively invoke getNextException()
until a null
value is returned.
Modifier and Type | Field and Description |
---|---|
static int |
UNKNOWN_ERROR_CODE |
Constructor and Description |
---|
OracleException(java.lang.String message)
Constructs an
OracleException object with a given message. |
OracleException(java.lang.String message,
int errorCode)
Constructs an
OracleException with a given message
and an error code. |
OracleException(java.lang.String message,
java.lang.Throwable cause,
int errorCode)
Constructs an
OracleException with a given message,
cause, error code, and error prefix. |
OracleException(java.lang.Throwable cause)
Constructs an
OracleException with a specified
cause (for example, a SQLException or an
IOException ). |
OracleException(java.lang.Throwable cause,
int errorCode)
Constructs an
OracleException with a specified
cause (for example, a SQLException or an
IOException ). |
Modifier and Type | Method and Description |
---|---|
int |
getErrorCode()
Returns the error code associated with this exception.
|
OracleException |
getNextException()
Returns the next OracleException in the chain or
null
if none. |
void |
setNextException(OracleException nextException)
Adds an
OracleException to the chain of exceptions. |
public static final int UNKNOWN_ERROR_CODE
public OracleException(java.lang.String message)
OracleException
object with a given message.message
- the description of the error. null
indicates
that the message string is non-existantpublic OracleException(java.lang.Throwable cause)
OracleException
with a specified
cause (for example, a SQLException
or an
IOException
).cause
- the causepublic OracleException(java.lang.Throwable cause, int errorCode)
OracleException
with a specified
cause (for example, a SQLException
or an
IOException
).cause
- the causeerrorCode
- integer error codepublic OracleException(java.lang.String message, int errorCode)
OracleException
with a given message
and an error code.message
- the description of the error. null
indicates
that the message string is non-existanterrorCode
- the error codepublic OracleException(java.lang.String message, java.lang.Throwable cause, int errorCode)
OracleException
with a given message,
cause, error code, and error prefix.message
- the description of the error. null
indicates
that the message string is non-existantcause
- the causeerrorCode
- the error codepublic int getErrorCode()
SQLException
, the
SQL error code is returned. Otherwise the error code
provided during construction is returned. If no error
code was provided during construction either,
OracleException.UNKNOWN_ERROR_CODE
is returned.public OracleException getNextException()
null
if none.null
if nonepublic void setNextException(OracleException nextException)
OracleException
to the chain of exceptions.nextException
- the exception