01: /*
02: * This software is released under the Apache Software Licence. See
03: * package.html for details. The latest version is available at
04: * http://proxool.sourceforge.net
05: */
06: package org.logicalcobwebs.proxool;
07:
08: import java.sql.SQLException;
09:
10: /**
11: * A type of SQLException that has been defined as fatal. It contains
12: * the {@link #getOriginalSQLException original} plain SQLException
13: * just in case you need it.
14: * @version $Revision: 1.3 $, $Date: 2003/09/10 22:21:04 $
15: * @author billhorsman
16: * @author $Author: chr32 $ (current maintainer)
17: * @see ConnectionPoolDefinitionIF#getFatalSqlExceptions
18: */
19: public class FatalSQLException extends SQLException {
20:
21: /**
22: * @see #getOriginalSQLException
23: */
24: private SQLException cause;
25:
26: public FatalSQLException(SQLException cause) {
27: this (cause, cause.getMessage(), cause.getSQLState());
28: }
29:
30: /**
31: * @param cause the SQLException that was detected as being fatal
32: * @param reason see {@link super#SQLException(java.lang.String, java.lang.String)}
33: * @param sqlState see {@link super#SQLException(java.lang.String, java.lang.String)}
34: */
35: public FatalSQLException(SQLException cause, String reason,
36: String sqlState) {
37: super (reason, sqlState);
38: this .cause = cause;
39: }
40:
41: /**
42: * Same as {@link #getOriginalSQLException}
43: * @see Throwable#getCause
44: */
45: public Throwable getCause() {
46: return cause;
47: }
48:
49: /**
50: * Get the SQLException that was detected as being fatal
51: * @return the original SQLException
52: */
53: public SQLException getOriginalSQLException() {
54: return cause;
55: }
56:
57: }
|