KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > java > sql > SQLDataException


1 /*
2  * @(#)SQLDataException.java 1.5 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 when the SQLState class value is '<i>22</i>'. This indicates
12  * various data errors, including but not limited to not-allowed conversion, division by 0
13  * and invalid arguments to functions.
14  *
15  * @since 1.6
16  */

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

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

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

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

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

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

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

147     public SQLDataException(String JavaDoc reason, String JavaDoc SQLState, int vendorCode, Throwable JavaDoc cause) {
148           super(reason, SQLState, vendorCode, cause);
149     }
150    
151    private static final long serialVersionUID = -6889123282670549800L;
152 }
153
Popular Tags