org.apache.commons.dbcp
public class: SQLNestedException [javadoc |
source]
java.lang.Object
java.lang.Throwable
java.lang.Exception
java.sql.SQLException
org.apache.commons.dbcp.SQLNestedException
All Implemented Interfaces:
Iterable, Serializable
A SQLException subclass containing another Throwable
- author:
Dirk - Verbeeck
- version:
$ - Revision: 479137 $ $Date: 2006-11-25 08:51:48 -0700 (Sat, 25 Nov 2006) $
| Constructor: |
public SQLNestedException(String msg,
Throwable cause) {
super(msg);
this.cause = cause;
if ((cause != null) && (DriverManager.getLogWriter() != null)) {
DriverManager.getLogWriter().print("Caused by: ");
cause.printStackTrace(DriverManager.getLogWriter());
}
}
Constructs a new SQLNestedException with specified
detail message and nested Throwable. Parameters:
msg - the error message
cause - the exception or error that caused this exception to be
thrown
|
| Methods from java.lang.Throwable: |
|---|
|
fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString |
| Method from org.apache.commons.dbcp.SQLNestedException Detail: |
public Throwable getCause() {
return this.cause;
}
|
public void printStackTrace(PrintStream s) {
super.printStackTrace(s);
if ((cause != null) && !hasThrowableCauseMethod()) {
s.print("Caused by: ");
this.cause.printStackTrace(s);
}
}
|
public void printStackTrace(PrintWriter s) {
super.printStackTrace(s);
if ((cause != null) && !hasThrowableCauseMethod()) {
s.print("Caused by: ");
this.cause.printStackTrace(s);
}
}
|