author | lancea |
Sun, 09 Apr 2017 14:25:07 -0400 | |
changeset 44550 | 3cf6d3d8a12a |
parent 25859 | 3317bb8137f4 |
permissions | -rw-r--r-- |
2 | 1 |
/* |
6531
30b5903e8301
6982510: Updated SQLException subclasses from the outback for 6861385 so that the copyrights only have 2 years
lancea
parents:
6528
diff
changeset
|
2 |
* Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. |
2 | 3 |
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 |
* |
|
5 |
* This code is free software; you can redistribute it and/or modify it |
|
6 |
* under the terms of the GNU General Public License version 2 only, as |
|
5506 | 7 |
* published by the Free Software Foundation. Oracle designates this |
2 | 8 |
* particular file as subject to the "Classpath" exception as provided |
5506 | 9 |
* by Oracle in the LICENSE file that accompanied this code. |
2 | 10 |
* |
11 |
* This code is distributed in the hope that it will be useful, but WITHOUT |
|
12 |
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
|
13 |
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
|
14 |
* version 2 for more details (a copy is included in the LICENSE file that |
|
15 |
* accompanied this code). |
|
16 |
* |
|
17 |
* You should have received a copy of the GNU General Public License version |
|
18 |
* 2 along with this work; if not, write to the Free Software Foundation, |
|
19 |
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
|
20 |
* |
|
5506 | 21 |
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
22 |
* or visit www.oracle.com if you need additional information or have any |
|
23 |
* questions. |
|
2 | 24 |
*/ |
25 |
||
26 |
package java.sql; |
|
27 |
||
28 |
/** |
|
6528
06df0b8bf209
6861385: Updated SQLException subclasses to clarify that they may be thrown for vendor specific conditions
lancea
parents:
5506
diff
changeset
|
29 |
* The subclass of {@link SQLException} thrown when the SQLState class value |
06df0b8bf209
6861385: Updated SQLException subclasses to clarify that they may be thrown for vendor specific conditions
lancea
parents:
5506
diff
changeset
|
30 |
* is '<i>22</i>', or under vendor-specified conditions. This indicates |
06df0b8bf209
6861385: Updated SQLException subclasses to clarify that they may be thrown for vendor specific conditions
lancea
parents:
5506
diff
changeset
|
31 |
* various data errors, including but not limited to data conversion errors, |
06df0b8bf209
6861385: Updated SQLException subclasses to clarify that they may be thrown for vendor specific conditions
lancea
parents:
5506
diff
changeset
|
32 |
* division by 0, and invalid arguments to functions. |
06df0b8bf209
6861385: Updated SQLException subclasses to clarify that they may be thrown for vendor specific conditions
lancea
parents:
5506
diff
changeset
|
33 |
* <p> |
06df0b8bf209
6861385: Updated SQLException subclasses to clarify that they may be thrown for vendor specific conditions
lancea
parents:
5506
diff
changeset
|
34 |
* Please consult your driver vendor documentation for the vendor-specified |
06df0b8bf209
6861385: Updated SQLException subclasses to clarify that they may be thrown for vendor specific conditions
lancea
parents:
5506
diff
changeset
|
35 |
* conditions for which this <code>Exception</code> may be thrown. |
2 | 36 |
* @since 1.6 |
37 |
*/ |
|
38 |
public class SQLDataException extends SQLNonTransientException { |
|
39 |
||
40 |
/** |
|
41 |
* Constructs a <code>SQLDataException</code> object. |
|
42 |
* The <code>reason</code>, <code>SQLState</code> are initialized |
|
43 |
* to <code>null</code> and the vendor code is initialized to 0. |
|
44 |
* |
|
45 |
* The <code>cause</code> is not initialized, and may subsequently be |
|
46 |
* initialized by a call to |
|
47 |
* {@link Throwable#initCause(java.lang.Throwable)} method. |
|
48 |
* |
|
49 |
* @since 1.6 |
|
50 |
*/ |
|
51 |
public SQLDataException() { |
|
52 |
super(); |
|
53 |
} |
|
54 |
||
55 |
/** |
|
56 |
* Constructs a <code>SQLDataException</code> object with a given |
|
57 |
* <code>reason</code>. |
|
58 |
* The <code>SQLState</code> is initialized |
|
59 |
* to <code>null</code> and the vendor code is initialized to 0. |
|
60 |
* |
|
61 |
* The <code>cause</code> is not initialized, and may subsequently be |
|
62 |
* initialized by a call to |
|
63 |
* {@link Throwable#initCause(java.lang.Throwable)} method. |
|
64 |
* |
|
65 |
* @param reason a description of the exception |
|
66 |
* @since 1.6 |
|
67 |
*/ |
|
68 |
public SQLDataException(String reason) { |
|
69 |
super(reason); |
|
70 |
} |
|
71 |
||
72 |
/** |
|
73 |
* Constructs a <code>SQLDataException</code> object with a given |
|
74 |
* <code>reason</code> and <code>SQLState</code>. The |
|
75 |
* vendor code is initialized to 0. |
|
76 |
* |
|
77 |
* The <code>cause</code> is not initialized, and may subsequently be |
|
78 |
* initialized by a call to |
|
79 |
* {@link Throwable#initCause(java.lang.Throwable)} method. |
|
23590 | 80 |
* |
2 | 81 |
* @param reason a description of the exception |
82 |
* @param SQLState an XOPEN or SQL:2003 code identifying the exception |
|
83 |
* @since 1.6 |
|
84 |
*/ |
|
85 |
public SQLDataException(String reason, String SQLState) { |
|
86 |
super(reason, SQLState); |
|
87 |
} |
|
88 |
||
89 |
/** |
|
90 |
* Constructs a <code>SQLDataException</code> object with a given |
|
91 |
* <code>reason</code>, <code>SQLState</code> and |
|
92 |
* <code>vendorCode</code>. |
|
93 |
* |
|
94 |
* The <code>cause</code> is not initialized, and may subsequently be |
|
95 |
* initialized by a call to |
|
96 |
* {@link Throwable#initCause(java.lang.Throwable)} method. |
|
23590 | 97 |
* |
2 | 98 |
* @param reason a description of the exception |
99 |
* @param SQLState an XOPEN or SQL:2003 code identifying the exception |
|
100 |
* @param vendorCode a database vendor specific exception code |
|
101 |
* @since 1.6 |
|
102 |
*/ |
|
103 |
public SQLDataException(String reason, String SQLState, int vendorCode) { |
|
104 |
super(reason, SQLState, vendorCode); |
|
105 |
} |
|
106 |
||
107 |
/** |
|
108 |
* Constructs a <code>SQLDataException</code> object with a given |
|
109 |
* <code>cause</code>. |
|
110 |
* The <code>SQLState</code> is initialized |
|
111 |
* to <code>null</code> and the vendor code is initialized to 0. |
|
112 |
* The <code>reason</code> is initialized to <code>null</code> if |
|
113 |
* <code>cause==null</code> or to <code>cause.toString()</code> if |
|
114 |
* <code>cause!=null</code>. |
|
23590 | 115 |
* |
2 | 116 |
* @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 |
117 |
* the cause is non-existent or unknown. |
|
118 |
* @since 1.6 |
|
119 |
*/ |
|
120 |
public SQLDataException(Throwable cause) { |
|
121 |
super(cause); |
|
122 |
} |
|
123 |
||
124 |
/** |
|
125 |
* Constructs a <code>SQLDataException</code> object with a given |
|
126 |
* <code>reason</code> and <code>cause</code>. |
|
127 |
* The <code>SQLState</code> is initialized to <code>null</code> |
|
128 |
* and the vendor code is initialized to 0. |
|
23590 | 129 |
* |
2 | 130 |
* @param reason a description of 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 SQLDataException(String reason, Throwable cause) { |
|
136 |
super(reason, cause); |
|
137 |
} |
|
138 |
||
139 |
/** |
|
140 |
* Constructs a <code>SQLDataException</code> object with a given |
|
141 |
* <code>reason</code>, <code>SQLState</code> and <code>cause</code>. |
|
142 |
* The vendor code is initialized to 0. |
|
23590 | 143 |
* |
2 | 144 |
* @param reason a description of the exception. |
145 |
* @param SQLState an XOPEN or SQL:2003 code identifying the exception |
|
146 |
* @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 |
|
147 |
* the cause is non-existent or unknown. |
|
148 |
* @since 1.6 |
|
149 |
*/ |
|
150 |
public SQLDataException(String reason, String SQLState, Throwable cause) { |
|
151 |
super(reason, SQLState, cause); |
|
152 |
} |
|
153 |
||
154 |
/** |
|
155 |
* Constructs a <code>SQLDataException</code> object with a given |
|
156 |
* <code>reason</code>, <code>SQLState</code>, <code>vendorCode</code> |
|
157 |
* and <code>cause</code>. |
|
23590 | 158 |
* |
2 | 159 |
* @param reason a description of the exception |
160 |
* @param SQLState an XOPEN or SQL:2003 code identifying the exception |
|
161 |
* @param vendorCode a database vendor-specific exception code |
|
162 |
* @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 |
|
163 |
* the cause is non-existent or unknown. |
|
164 |
* @since 1.6 |
|
165 |
*/ |
|
166 |
public SQLDataException(String reason, String SQLState, int vendorCode, Throwable cause) { |
|
167 |
super(reason, SQLState, vendorCode, cause); |
|
168 |
} |
|
169 |
||
170 |
private static final long serialVersionUID = -6889123282670549800L; |
|
171 |
} |