KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > java > sql > SQLRecoverableException


1 /*
2  * @(#)SQLRecoverableException.java 1.2 06/07/10
3  *
4  * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
5  * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
6  */

7
8 package java.sql;
9
10 /**
11  * The subclass of {@link SQLException} thrown in situations where a
12  * previously failed operation might be able to succeed if the application performs
13  * some recovery steps and retries the entire transaction or in the case of a
14  * distributed transaction, the transaction branch. At a minimum,
15  * the recovery operation must include closing the current connection and getting
16  * a new connection.
17  *<p>
18  *
19  * @since 1.6
20  */

21 public class SQLRecoverableException extends java.sql.SQLException JavaDoc {
22
23     /**
24      * Constructs a <code>SQLRecoverableException</code> object.
25          * The <code>reason</code>, <code>SQLState</code> are initialized
26          * to <code>null</code> and the vendor code is initialized to 0.
27          *
28          * The <code>cause</code> is not initialized, and may subsequently be
29          * initialized by a call to the
30          * {@link Throwable#initCause(java.lang.Throwable)} method.
31          * <p>
32      * @since 1.6
33         */

34     public SQLRecoverableException() {
35         super();
36     }
37     
38     /**
39      * Constructs a <code>SQLRecoverableException</code> object
40          * with a given <code>reason</code>. The <code>SQLState</code>
41          * is initialized to <code>null</code> and the vender code is initialized
42          * to 0.
43          *
44          * The <code>cause</code> is not initialized, and may subsequently be
45          * initialized by a call to the
46          * {@link Throwable#initCause(java.lang.Throwable)} method.
47          * <p>
48      * @param reason a description of the exception
49      * @since 1.6
50          */

51     public SQLRecoverableException(String JavaDoc reason) {
52         super(reason);
53     }
54     
55     /**
56      * Constructs a <code>SQLRecoverableException</code> object
57          * with a given <code>reason</code> and <code>SQLState</code>.
58          *
59          * The <code>cause</code> is not initialized, and may subsequently be
60          * initialized by a call to the
61          * {@link Throwable#initCause(java.lang.Throwable)} method. The vendor code
62          * is initialized to 0.
63          * <p>
64      * @param reason a description of the exception
65      * @param SQLState an XOPEN or SQL:2003 code identifying the exception
66      * @since 1.6
67          */

68     public SQLRecoverableException(String JavaDoc reason, String JavaDoc SQLState) {
69         super(reason, SQLState);
70     }
71     
72     /**
73      * Constructs a <code>SQLRecoverableException</code> object
74          * with a given <code>reason</code>, <code>SQLState</code> and
75          * <code>vendorCode</code>.
76          *
77          * The <code>cause</code> is not initialized, and may subsequently be
78          * initialized by a call to the
79          * {@link Throwable#initCause(java.lang.Throwable)} method.
80          * <p>
81      * @param reason a description of the exception
82      * @param SQLState an XOPEN or SQL:2003 code identifying the exception
83      * @param vendorCode a database vendor specific exception code
84      * @since 1.6
85          */

86     public SQLRecoverableException(String JavaDoc reason, String JavaDoc SQLState, int vendorCode) {
87         super(reason, SQLState, vendorCode);
88     }
89     
90     /**
91      * Constructs a <code>SQLRecoverableException</code> object
92      * with a given <code>cause</code>.
93      * The <code>SQLState</code> is initialized
94      * to <code>null</code> and the vendor code is initialized to 0.
95      * The <code>reason</code> is initialized to <code>null</code> if
96      * <code>cause==null</code> or to <code>cause.toString()</code> if
97      * <code>cause!=null</code>.
98      * <p>
99      * @param cause the underlying reason for this <code>SQLException</code> (which is saved for later retrieval by the <code>getCause()</code> method); may be null indicating
100      * the cause is non-existent or unknown.
101      * @since 1.6
102      */

103     public SQLRecoverableException(Throwable JavaDoc cause) {
104         super(cause);
105     }
106
107     /**
108      * Constructs a <code>SQLRecoverableException</code> object
109      * with a given
110      * <code>reason</code> and <code>cause</code>.
111      * The <code>SQLState</code> is initialized to <code>null</code>
112      * and the vendor code is initialized to 0.
113      * <p>
114      * @param reason a description of the exception.
115      * @param cause the underlying reason for this <code>SQLException</code> (which is saved for later retrieval by the <code>getCause()</code> method); may be null indicating
116      * the cause is non-existent or unknown.
117      * @since 1.6
118      */

119     public SQLRecoverableException(String JavaDoc reason, Throwable JavaDoc cause) {
120         super(reason, cause);
121     }
122     
123     /**
124      * Constructs a <code>SQLRecoverableException</code> object
125      * with a given
126      * <code>reason</code>, <code>SQLState</code> and <code>cause</code>.
127      * The vendor code is initialized to 0.
128      * <p>
129      * @param reason a description of the exception.
130      * @param SQLState an XOPEN or SQL:2003 code identifying the exception
131      * @param cause the underlying reason for this <code>SQLException</code> (which is saved for later retrieval by the <code>getCause()</code> method); may be null indicating
132      * the cause is non-existent or unknown.
133      * @since 1.6
134      */

135     public SQLRecoverableException(String JavaDoc reason, String JavaDoc SQLState, Throwable JavaDoc cause) {
136         super(reason, SQLState, cause);
137     }
138     
139     /**
140      * Constructs a <code>SQLRecoverableException</code> object
141      * with a given
142      * <code>reason</code>, <code>SQLState</code>, <code>vendorCode</code>
143      * and <code>cause</code>.
144      * <p>
145      * @param reason a description of the exception
146      * @param SQLState an XOPEN or SQL:2003 code identifying the exception
147      * @param vendorCode a database vendor-specific exception code
148      * @param cause the underlying reason for this <code>SQLException</code> (which is saved for later retrieval by the <code>getCause()</code> method); may be null indicating
149      * the cause is non-existent or unknown.
150      * @since 1.6
151      */

152     public SQLRecoverableException(String JavaDoc reason, String JavaDoc SQLState, int vendorCode, Throwable JavaDoc cause) {
153         super(reason, SQLState, vendorCode, cause);
154     }
155   
156    private static final long serialVersionUID = -4144386502923131579L;
157 }
158
Popular Tags