ModSQL
Class SQLExceptionWithCause

java.lang.Object
  |
  +--java.lang.Throwable
        |
        +--java.lang.Exception
              |
              +--java.sql.SQLException
                    |
                    +--ModSQL.SQLExceptionWithCause
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
DatabaseException

public class SQLExceptionWithCause
extends SQLException

Updated version of SQLException implementing Java 1.4 cause objects.

Author:
chris.studholme@utoronto.ca
See Also:
Serialized Form

Field Summary
private  Throwable cause
          Cause of exception.
 
Fields inherited from class java.sql.SQLException
next, SQLState, vendorCode
 
Fields inherited from class java.lang.Throwable
backtrace, detailMessage, serialVersionUID
 
Constructor Summary
SQLExceptionWithCause()
          Default constructor.
SQLExceptionWithCause(String message)
          Exception with a specific reason.
SQLExceptionWithCause(String message, Throwable cause)
          Exception that was caused by some other exception.
SQLExceptionWithCause(Throwable cause)
          Exception that was caused by some other exception.
 
Method Summary
 Throwable getCause()
          Returns the cause of this throwable or null if the cause is nonexistent or unknown.
 
Methods inherited from class java.sql.SQLException
getErrorCode, getNextException, getSQLState, setNextException
 
Methods inherited from class java.lang.Throwable
fillInStackTrace, getLocalizedMessage, getMessage, printStackTrace, printStackTrace, printStackTrace, printStackTrace0, toString
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, wait, wait, wait
 

Field Detail

cause

private Throwable cause
Cause of exception.
Constructor Detail

SQLExceptionWithCause

public SQLExceptionWithCause()
Default constructor.

SQLExceptionWithCause

public SQLExceptionWithCause(String message)
Exception with a specific reason.
Parameters:
message - reason exception was thrown

SQLExceptionWithCause

public SQLExceptionWithCause(String message,
                             Throwable cause)
Exception that was caused by some other exception.
Parameters:
message - reason exception was thrown
cause - the cause of this exception

SQLExceptionWithCause

public SQLExceptionWithCause(Throwable cause)
Exception that was caused by some other exception.
Parameters:
cause - the cause of this exception
Method Detail

getCause

public Throwable getCause()
Returns the cause of this throwable or null if the cause is nonexistent or unknown. (The cause is the throwable that caused this throwable to get thrown.)
Returns:
the cause of this throwable or null if the cause is unknown