KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > java > sql > SQLTransientException


1 /*
2  * %W% %E%
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} is thrown in situations where a
12  * previoulsy failed operation might be able to succeed when the operation is
13  * retried without any intervention by application-level functionality.
14  *<p>
15  *
16  * @since 1.6
17  */

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

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

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

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

83     public SQLTransientException(String JavaDoc reason, String JavaDoc SQLState, int vendorCode) {
84         super(reason,SQLState,vendorCode);
85     }
86     
87     /**
88      * Constructs a <code>SQLTransientException</code> object
89      * with a given <code>cause</code>.
90      * The <code>SQLState</code> is initialized
91      * to <code>null</code> and the vendor code is initialized to 0.
92      * The <code>reason</code> is initialized to <code>null</code> if
93      * <code>cause==null</code> or to <code>cause.toString()</code> if
94      * <code>cause!=null</code>.
95      * <p>
96      * @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
97      * the cause is non-existent or unknown.
98      * @since 1.6
99      */

100     public SQLTransientException(Throwable JavaDoc cause) {
101         super(cause);
102     }
103
104     /**
105      * Constructs a <code>SQLTransientException</code> object
106      * with a given
107      * <code>reason</code> and <code>cause</code>.
108      * The <code>SQLState</code> is initialized to <code>null</code>
109      * and the vendor code is initialized to 0.
110      * <p>
111      * @param reason a description of the exception.
112      * @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
113      * the cause is non-existent or unknown.
114      * @since 1.6
115      */

116     public SQLTransientException(String JavaDoc reason, Throwable JavaDoc cause) {
117         super(reason,cause);
118     }
119     
120     /**
121      * Constructs a <code>SQLTransientException</code> object
122      * with a given
123      * <code>reason</code>, <code>SQLState</code> and <code>cause</code>.
124      * The vendor code is initialized to 0.
125      * <p>
126      * @param reason a description of the exception.
127      * @param SQLState an XOPEN or SQL:2003 code identifying the exception
128      * @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
129      * the cause is non-existent or unknown.
130      * @since 1.6
131      */

132     public SQLTransientException(String JavaDoc reason, String JavaDoc SQLState, Throwable JavaDoc cause) {
133         super(reason,SQLState,cause);
134     }
135     
136     /**
137      * Constructs a <code>SQLTransientException</code> object
138      * with a given
139      * <code>reason</code>, <code>SQLState</code>, <code>vendorCode</code>
140      * and <code>cause</code>.
141      * <p>
142      * @param reason a description of the exception
143      * @param SQLState an XOPEN or SQL:2003 code identifying the exception
144      * @param vendorCode a database vendor-specific exception code
145      * @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
146      * the cause is non-existent or unknown.
147      * @since 1.6
148      */

149     public SQLTransientException(String JavaDoc reason, String JavaDoc SQLState, int vendorCode, Throwable JavaDoc cause) {
150         super(reason,SQLState,vendorCode,cause);
151     }
152   
153     private static final long serialVersionUID = -9042733978262274539L;
154 }
155
Popular Tags