author | psadhukhan |
Fri, 09 Nov 2018 09:29:43 +0530 | |
changeset 52543 | 3853631e6a07 |
parent 47216 | 71c04702a3d5 |
permissions | -rw-r--r-- |
2 | 1 |
/* |
23010
6dadb192ad81
8029235: Update copyright year to match last edit in jdk8 jdk repository for 2013
lana
parents:
21278
diff
changeset
|
2 |
* Copyright (c) 2005, 2013, 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>42</i>', or under vendor-specified conditions. This indicates that the |
2 | 31 |
* in-progress query has violated SQL syntax rules. |
6528
06df0b8bf209
6861385: Updated SQLException subclasses to clarify that they may be thrown for vendor specific conditions
lancea
parents:
5506
diff
changeset
|
32 |
* <p> |
06df0b8bf209
6861385: Updated SQLException subclasses to clarify that they may be thrown for vendor specific conditions
lancea
parents:
5506
diff
changeset
|
33 |
* 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
|
34 |
* conditions for which this <code>Exception</code> may be thrown. |
2 | 35 |
* @since 1.6 |
36 |
*/ |
|
37 |
public class SQLSyntaxErrorException extends SQLNonTransientException { |
|
38 |
||
39 |
/** |
|
40 |
* Constructs a <code>SQLSyntaxErrorException</code> object. |
|
41 |
* The <code>reason</code>, <code>SQLState</code> are initialized |
|
42 |
* to <code>null</code> and the vendor code is initialized 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. |
|
23590 | 47 |
* |
2 | 48 |
* @since 1.6 |
49 |
*/ |
|
50 |
public SQLSyntaxErrorException() { |
|
51 |
super(); |
|
52 |
} |
|
53 |
||
54 |
/** |
|
55 |
* Constructs a <code>SQLSyntaxErrorException</code> object |
|
56 |
* with a given <code>reason</code>. The <code>SQLState</code> |
|
21278 | 57 |
* is initialized to <code>null</code> and the vendor code is initialized |
2 | 58 |
* to 0. |
59 |
* |
|
60 |
* The <code>cause</code> is not initialized, and may subsequently be |
|
61 |
* initialized by a call to the |
|
62 |
* {@link Throwable#initCause(java.lang.Throwable)} method. |
|
23590 | 63 |
* |
2 | 64 |
* @param reason a description of the exception |
65 |
* @since 1.6 |
|
66 |
*/ |
|
67 |
public SQLSyntaxErrorException(String reason) { |
|
68 |
super(reason); |
|
69 |
} |
|
70 |
||
71 |
/** |
|
72 |
* Constructs a <code>SQLSyntaxErrorException</code> object |
|
73 |
* with a given <code>reason</code> and <code>SQLState</code>. |
|
74 |
* |
|
75 |
* The <code>cause</code> is not initialized, and may subsequently be |
|
76 |
* initialized by a call to the |
|
77 |
* {@link Throwable#initCause(java.lang.Throwable)} method. The vendor code |
|
78 |
* is initialized to 0. |
|
23590 | 79 |
* |
2 | 80 |
* @param reason a description of the exception |
81 |
* @param SQLState an XOPEN or SQL:2003 code identifying the exception |
|
82 |
* @since 1.6 |
|
83 |
*/ |
|
84 |
public SQLSyntaxErrorException(String reason, String SQLState) { |
|
85 |
super(reason, SQLState); |
|
86 |
} |
|
87 |
||
88 |
/** |
|
89 |
* Constructs a <code>SQLSyntaxErrorException</code> object |
|
90 |
* with a given <code>reason</code>, <code>SQLState</code> and |
|
91 |
* <code>vendorCode</code>. |
|
92 |
* |
|
93 |
* The <code>cause</code> is not initialized, and may subsequently be |
|
94 |
* initialized by a call to the |
|
95 |
* {@link Throwable#initCause(java.lang.Throwable)} method. |
|
23590 | 96 |
* |
2 | 97 |
* @param reason a description of the exception |
98 |
* @param SQLState an XOPEN or SQL:2003 code identifying the exception |
|
99 |
* @param vendorCode a database vendor specific exception code |
|
100 |
* @since 1.6 |
|
101 |
*/ |
|
102 |
public SQLSyntaxErrorException(String reason, String SQLState, int vendorCode) { |
|
103 |
super(reason, SQLState, vendorCode); |
|
104 |
} |
|
105 |
||
106 |
/** |
|
107 |
* Constructs a <code>SQLSyntaxErrorException</code> object |
|
108 |
* with a given <code>cause</code>. |
|
109 |
* The <code>SQLState</code> is initialized |
|
110 |
* to <code>null</code> and the vendor code is initialized to 0. |
|
111 |
* The <code>reason</code> is initialized to <code>null</code> if |
|
112 |
* <code>cause==null</code> or to <code>cause.toString()</code> if |
|
113 |
* <code>cause!=null</code>. |
|
23590 | 114 |
* |
21278 | 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 |
2 | 116 |
* the cause is non-existent or unknown. |
117 |
* @since 1.6 |
|
118 |
*/ |
|
119 |
public SQLSyntaxErrorException(Throwable cause) { |
|
120 |
super(cause); |
|
121 |
} |
|
122 |
||
123 |
/** |
|
124 |
* Constructs a <code>SQLSyntaxErrorException</code> object |
|
125 |
* 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 SQLSyntaxErrorException(String reason, Throwable cause) { |
|
136 |
super(reason, cause); |
|
137 |
} |
|
138 |
||
139 |
/** |
|
140 |
* Constructs a <code>SQLSyntaxErrorException</code> object |
|
141 |
* with a given |
|
142 |
* <code>reason</code>, <code>SQLState</code> and <code>cause</code>. |
|
143 |
* The vendor code is initialized to 0. |
|
23590 | 144 |
* |
2 | 145 |
* @param reason a description of the exception. |
146 |
* @param SQLState an XOPEN or SQL:2003 code identifying the exception |
|
147 |
* @param cause the (which is saved for later retrieval by the <code>getCause()</code> method); may be null indicating |
|
148 |
* the cause is non-existent or unknown. |
|
149 |
* @since 1.6 |
|
150 |
*/ |
|
151 |
public SQLSyntaxErrorException(String reason, String SQLState, Throwable cause) { |
|
152 |
super(reason, SQLState, cause); |
|
153 |
} |
|
154 |
||
155 |
/** |
|
156 |
* Constructs a <code>SQLSyntaxErrorException</code> object |
|
157 |
* with a given |
|
158 |
* <code>reason</code>, <code>SQLState</code>, <code>vendorCode</code> |
|
159 |
* and <code>cause</code>. |
|
23590 | 160 |
* |
2 | 161 |
* @param reason a description of the exception |
162 |
* @param SQLState an XOPEN or SQL:2003 code identifying the exception |
|
163 |
* @param vendorCode a database vendor-specific exception code |
|
164 |
* @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 |
|
165 |
* the cause is non-existent or unknown. |
|
166 |
* @since 1.6 |
|
167 |
*/ |
|
168 |
public SQLSyntaxErrorException(String reason, String SQLState, int vendorCode, Throwable cause) { |
|
169 |
super(reason, SQLState, vendorCode, cause); |
|
170 |
} |
|
171 |
||
172 |
private static final long serialVersionUID = -1843832610477496053L; |
|
173 |
} |