com.ibm.pdq.runtime.exception
Class DataRuntimeException

java.lang.Object
  extended by java.lang.Throwable
      extended by java.lang.Exception
          extended by java.lang.RuntimeException
              extended by com.ibm.pdq.runtime.exception.DataRuntimeException
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
GenerationException, UpdateManyException

public class DataRuntimeException
extends RuntimeException

Indicates the occurrence of an exception in a pureQuery method.

See Also:
Serialized Form

Method Summary

Method Summary
Return Data TypeMethod Name and Description
void addLastException(DataRuntimeException newException)
Adds the DataRuntimeException newException as the last Exception in a linked list of DataRuntimeExceptions.
Integer getErrorCode()
Returns the error code for this DataRuntimeException.
ErrorType getErrorType()
Returns an ErrorType object that indicates the error type of this DataRuntimeException.
int getExceptionLocation()
Returns the int that indicates where in the code the exception occurred.
String getMessage()
Returns the message that is associated with the exception.
DataRuntimeException getNextException()
Returns the DataRuntimeException nextException that is the next Exception in a linked list of DataRuntimeExceptions.
String getProductVersion()
Returns a String that indicates the version of the pureQuery code in which the exception occurred.
String getSQLState()
Returns the SQLState for this DataRuntimeException.
boolean isTransient()
Returns a boolean value that indicates whether the action that resulted in this exception has a chance to succeed if attempted again.

Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString

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

Method Detail

addLastException

public void addLastException(DataRuntimeException newException)
Adds the DataRuntimeException newException as the last Exception in a linked list of DataRuntimeExceptions. The DataRuntimeException instance on which the addLastException method is called is also a member of that linked list. This linked list can be used to record a sequence of DataRuntimeExceptions that occur. The next Exception in the linked list can be obtained by using getNextException().
Parameters:
newException - a DataRuntimeException instance to be added as the last Exception in the linked list of DataRuntimeExceptions
See Also:
getNextException()

getErrorCode

public Integer getErrorCode()
Returns the error code for this DataRuntimeException. If the DataRuntimeException exception has an SQLException object as its cause (getCause()), this method returns the error code of the cause exception (cause.getErrorCode()). In other cases, this method might return an error code that is generated by pureQuery. If no error code is available, this method returns -99999.
Returns:
the error code of this exception.

getErrorType

public ErrorType getErrorType()
Returns an ErrorType object that indicates the error type of this DataRuntimeException. If the DataRuntimeException has an SQLException object as its cause (getCause()), the error type is derived from the SQLState and error code of the cause. If the cause is not an SQLException, this method returns ErrorType.UNCATEGORIZED_ERROR.
Returns:
the error type of the exception.

getExceptionLocation

public int getExceptionLocation()
Returns the int that indicates where in the code the exception occurred.
Returns:
the int that indicates where in the code the exception occurred

getMessage

public String getMessage()
Returns the message that is associated with the exception.
Overrides:
getMessage in class Throwable

getNextException

public DataRuntimeException getNextException()
Returns the DataRuntimeException nextException that is the next Exception in a linked list of DataRuntimeExceptions. The DataRuntimeException instance on which the getNextException method is called is also a member of that linked list. This linked list can be used to record a sequence of DataRuntimeExceptions that occur. A DataRuntimeException can be added to the end of the linked list by calling addLastException(DataRuntimeException).
Returns:
the DataRuntimeException instance that is the next Exception in the linked list of DataRuntimeExceptions
See Also:
addLastException(DataRuntimeException)

getProductVersion

public String getProductVersion()
Returns a String that indicates the version of the pureQuery code in which the exception occurred.
Returns:
a String that indicates the version of the pureQuery code in which the exception occurred

getSQLState

public String getSQLState()
Returns the SQLState for this DataRuntimeException. If the DataRuntimeException exception has an SQLException object as its cause (getCause()), this method returns the SQLState of the cause exception (cause.getSQLState(), or null if its SQLState is null). If there is no cause exception, or if the cause is not an SQLException, this method returns "FFFFF".
Returns:
the SQLState of this exception.

isTransient

public boolean isTransient()
Returns a boolean value that indicates whether the action that resulted in this exception has a chance to succeed if attempted again. The value true indicates that an operation that previously failed might be able to succeed if the operation is retried without any intervention by application-level functionality.
Returns:
a boolean that indicates whether the action that resulted in this exception has a chance to succeed if attempted again.