Oracle Fusion Middleware Java API Reference for Oracle Extension SDK
11g Release 2 (11.1.2.1.0)

E17493-02

oracle.javatools.db
Class DBException

java.lang.Object
  extended by java.lang.Throwable
      extended by java.lang.Exception
          extended by oracle.javatools.db.DBException
All Implemented Interfaces:
java.io.Serializable
Direct Known Subclasses:
CancelledException, CascadeManager.NoCascadeRequiredException, CascadeRequiredException, DBSQLException, DependentProviderUpdateException, HandlerFailedException, MissingPropertyException, MissingProviderException, SQLQueryException, ValidationException

public class DBException
extends java.lang.Exception

An Exception that is thrown by a DB model operation. DBExceptions can wrap another exception. For example, operations against a JDBC Database may result in a SQLException; this SQLException can be wrapped in a DBException for reporting back to callers.
DBExceptions can be chained so that operations such as validation, or the creation of multiple objects can result in numberous errors reported.

See Also:
Serialized Form

Constructor Summary
protected DBException()
          Allows subclasses to deal with objects/messages as appropriate.
  DBException(DBObject obj, java.lang.String msg)
          Constructs a new DBException on the specified object with the specified message.
  DBException(DBObject obj, java.lang.String msg, java.lang.Throwable cause)
          Constructs a new DBException on the specified object with the specified message and wrapping the specified throwable
  DBException(DBObject obj, java.lang.Throwable cause)
          Constructs a new DBException on the specified object wrapping the specified throwable
  DBException(java.lang.Throwable cause)
          Constructs a new DBException wrapping a throwable, without an object.
 
Method Summary
 DBException getNextException()
          Retrieves the exception chained to this DBException object.
 DBObject getObject()
          The object on which this exception occurred.
 void setNextException(DBException ex)
          Adds an DBException object to the end of the chain.
 
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DBException

public DBException(DBObject obj,
                   java.lang.String msg)
Constructs a new DBException on the specified object with the specified message.

Parameters:
obj - the object on which the exception occurred.
msg - the message describing the exception.

DBException

public DBException(DBObject obj,
                   java.lang.String msg,
                   java.lang.Throwable cause)
Constructs a new DBException on the specified object with the specified message and wrapping the specified throwable

Parameters:
obj - the object on which the exception occurred.
msg - the message describing the exception.
cause - the root cause of the exception

DBException

public DBException(DBObject obj,
                   java.lang.Throwable cause)
Constructs a new DBException on the specified object wrapping the specified throwable

Parameters:
obj - the object on which the exception occurred.
cause - the root cause of the exception

DBException

public DBException(java.lang.Throwable cause)
Constructs a new DBException wrapping a throwable, without an object. This constructor can be used to report errors that are not associated with a specific object - for example, when getting a list of objects from a DBObjectProvider.

Parameters:
cause - the Throwable that represents the underlying problem.

DBException

protected DBException()
Allows subclasses to deal with objects/messages as appropriate.

Method Detail

getObject

public DBObject getObject()
The object on which this exception occurred.

Returns:
the DBObject on which this exception occurred.

getNextException

public DBException getNextException()
Retrieves the exception chained to this DBException object.

Returns:
the next DBException object in the chain; null if there are none
See Also:
setNextException(oracle.javatools.db.DBException)

setNextException

public void setNextException(DBException ex)
Adds an DBException object to the end of the chain.

Parameters:
ex - the new exception that will be added to the end of the DBException chain
See Also:
getNextException()

Oracle Fusion Middleware Java API Reference for Oracle Extension SDK
11g Release 2 (11.1.2.1.0)

E17493-02

Copyright © 1997, 2011, Oracle. All rights reserved.