KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > logicalcobwebs > proxool > FatalSQLException


1 /*
2  * This software is released under the Apache Software Licence. See
3  * package.html for details. The latest version is available at
4  * http://proxool.sourceforge.net
5  */

6 package org.logicalcobwebs.proxool;
7
8 import java.sql.SQLException JavaDoc;
9
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 JavaDoc {
20
21     /**
22      * @see #getOriginalSQLException
23      */

24     private SQLException JavaDoc cause;
25
26     public FatalSQLException(SQLException JavaDoc 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 JavaDoc cause, String JavaDoc reason, String JavaDoc sqlState) {
36         super(reason, sqlState);
37         this.cause = cause;
38     }
39
40     /**
41      * Same as {@link #getOriginalSQLException}
42      * @see Throwable#getCause
43      */

44     public Throwable JavaDoc getCause() {
45         return cause;
46     }
47
48     /**
49      * Get the SQLException that was detected as being fatal
50      * @return the original SQLException
51      */

52     public SQLException JavaDoc getOriginalSQLException() {
53         return cause;
54     }
55
56 }
57
Popular Tags