org.eclipse.datatools.connectivity.oda
Class OdaException

java.lang.Object
  extended byjava.lang.Throwable
      extended byjava.lang.Exception
          extended byorg.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:

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.

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.

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

toString

public java.lang.String toString()


Copyright © 2006 Actuate, IBM Corporation, Sybase, Inc. and others. All rights reserved.