## org.eclipse.datatools.connectivity.oda
Class OdaException

    java.lang.Object
      java.lang.Throwable
          java.lang.Exception
              org.eclipse.datatools.connectivity.oda.OdaException

All Implemented Interfaces:
  java.io.Serializable

    public class OdaException

extends java.lang.Exception

An exception class that provides information on an ODA runtime driver error or other data provider errors.

Each `OdaException` provides several kinds of information:

- a string describing the error. This is used as the Java Exception message, available via the method `getMessage`.
- a SQLSTATE string, which follows either the XOPEN SQLSTATE conventions or the SQL 99 conventions. The values of the SQLSTATE string are described in the corresponding spec. The method `IDataSetMetaData.getSQLStateType()` can be used to discover whether the driver returns the XOPEN type or the SQL 99 type.
- an integer exception code that is specific to each vendor. Normally this will be the actual error code returned by the underlying data provider.
- a chain to the next OdaException. This can be used to provide additional error information.

Note: The OdaException chain is different from the "Cause" that was introduced in Java SDK 1.4 Throwable. The chain is meant to handle situations where multiple (possibly unrelated) OdaExceptions may occur.

See Also:
  Serialized Form

Constructor Summary
`OdaException()` Instantiates an OdaException object whose message text defaults to null, SQLSTATE defaults to null, and vendorCode defaults to 0.
`OdaException(java.lang.String message)` Instantiates an OdaException object with a message.
`OdaException(java.lang.String message, java.lang.String sqlState)` Instantiates an OdaException object with a message and SQLSTATE.
`OdaException(java.lang.String message, java.lang.String sqlState, int vendorCode)` Instantiates a fully specified OdaException object.
`OdaException(java.lang.Throwable cause)` Instantiates an OdaException object whose message text defaults to null, and initialized with given cause.

Method Summary
`java.lang.Throwable` `getCause()` Returns the cause of this `OdaException`, or `null` if the cause is nonexistent or unknown.
`int` `getErrorCode()` Returns the vendor-specific exception code of this `OdaException` object.
`OdaException` `getNextException()` Returns the next `OdaException` chained to this `OdaException` object.
`java.lang.String` `getSQLState()` Returns the SQLSTATE of this `OdaException` object.
`java.lang.Throwable` `initCause(java.lang.Throwable cause)` Initializes the cause of this OdaException to the specified value.
`void` `setNextException(OdaException nextException)` Adds an `OdaException` object to the end of the `OdaException` chain.
`java.lang.String` `toString()`

Methods inherited from class java.lang.Throwable
`fillInStackTrace, getLocalizedMessage, getMessage, getStackTrace, printStackTrace, printStackTrace, printStackTrace, setStackTrace`

Methods inherited from class java.lang.Object
`equals, getClass, hashCode, notify, notifyAll, wait, wait, wait`

Constructor Detail

### OdaException

    public OdaException()

  Instantiates an OdaException object whose message text defaults to null, SQLSTATE defaults to null, and vendorCode defaults to 0.

### OdaException

    public OdaException(java.lang.String message)

  Instantiates an OdaException object with a message. The SQLSTATE defaults to null, and vendorCode defaults to 0.

  Parameters:
    `message` - description of the exception.

### OdaException

    public OdaException(java.lang.String message,
                        java.lang.String sqlState)

  Instantiates an OdaException object with a message and SQLSTATE. The vendorCode defaults to 0.

  Parameters:
    `message` - description of the exception.
    `sqlState` - an XOPEN or SQL 99 code identifying the exception.

### OdaException

    public OdaException(java.lang.String message,
                        java.lang.String sqlState,
                        int vendorCode)

  Instantiates a fully specified OdaException object.

  Parameters:
    `message` - description of the exception.
    `sqlState` - an XOPEN or SQL 99 code identifying the exception.
    `vendorCode` - a data provider vendor-specific exception code.

### OdaException

    public OdaException(java.lang.Throwable cause)

  Instantiates an OdaException object whose message text defaults to null, and initialized with given cause.

  Parameters:
    `cause` - cause of exception

Method Detail

### getSQLState

    public java.lang.String getSQLState()

  Returns the SQLSTATE of this `OdaException` object.

  Returns:
    the SQLSTATE value.

### getErrorCode

    public int getErrorCode()

  Returns the vendor-specific exception code of this `OdaException` object.

  Returns:
    the vendor's exception code.

### getNextException

    public OdaException getNextException()

  Returns the next `OdaException` chained to this `OdaException` object.

  Returns:
    the next `OdaException` object in the chain, null if there are none.

### setNextException

    public void setNextException(OdaException nextException)

  Adds an `OdaException` object to the end of the `OdaException` chain.

  Parameters:
    `nextException` - the new `OdaException` object to be added to the `OdaException` chain.

### initCause

    public java.lang.Throwable initCause(java.lang.Throwable cause)
                                  throws java.lang.IllegalArgumentException,
                                         java.lang.IllegalStateException

  Initializes the cause of this OdaException to the specified value. The cause is the throwable that caused this OdaException to get thrown. This method can be called at most once.

  Overrides:
    `initCause` in class `java.lang.Throwable`
  Parameters:
    `cause` - the cause of this OdaException. A `null` value is permitted and indicates that the cause is nonexistent or unknown.
  Returns:
    a reference to this `OdaException`.
  Throws:
    `java.lang.IllegalArgumentException` - if `cause` is this OdaException. IllegalStateException if this method has already been called on this `OdaException`.
    `java.lang.IllegalStateException`

### getCause

    public java.lang.Throwable getCause()

  Returns the cause of this `OdaException`, or `null` if the cause is nonexistent or unknown.

  Overrides:
    `getCause` in class `java.lang.Throwable`
  Returns:
    the cause of this `OdaException`, or `null` if the cause is nonexistent or unknown.

### toString

    public java.lang.String toString()

  Overrides:
    `toString` in class `java.lang.Throwable`