Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
PojavLauncherTeam
GitHub Repository: PojavLauncherTeam/mobile
Path: blob/master/src/java.sql/share/classes/java/sql/SQLSyntaxErrorException.java
41153 views
1
/*
2
* Copyright (c) 2005, 2020, Oracle and/or its affiliates. All rights reserved.
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
7
* published by the Free Software Foundation. Oracle designates this
8
* particular file as subject to the "Classpath" exception as provided
9
* by Oracle in the LICENSE file that accompanied this code.
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
*
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.
24
*/
25
26
package java.sql;
27
28
/**
29
* The subclass of {@link SQLException} thrown when the SQLState class value
30
* is '<i>42</i>', or under vendor-specified conditions. This indicates that the
31
* in-progress query has violated SQL syntax rules.
32
* <p>
33
* Please consult your driver vendor documentation for the vendor-specified
34
* conditions for which this {@code Exception} may be thrown.
35
* @since 1.6
36
*/
37
public class SQLSyntaxErrorException extends SQLNonTransientException {
38
39
/**
40
* Constructs a {@code SQLSyntaxErrorException} object.
41
* The {@code reason}, {@code SQLState} are initialized
42
* to {@code null} and the vendor code is initialized to 0.
43
*
44
* The {@code cause} is not initialized, and may subsequently be
45
* initialized by a call to the
46
* {@link Throwable#initCause(java.lang.Throwable)} method.
47
*
48
* @since 1.6
49
*/
50
public SQLSyntaxErrorException() {
51
super();
52
}
53
54
/**
55
* Constructs a {@code SQLSyntaxErrorException} object
56
* with a given {@code reason}. The {@code SQLState}
57
* is initialized to {@code null} and the vendor code is initialized
58
* to 0.
59
*
60
* The {@code cause} is not initialized, and may subsequently be
61
* initialized by a call to the
62
* {@link Throwable#initCause(java.lang.Throwable)} method.
63
*
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} object
73
* with a given {@code reason} and {@code SQLState}.
74
*
75
* The {@code cause} 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.
79
*
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} object
90
* with a given {@code reason}, {@code SQLState} and
91
* {@code vendorCode}.
92
*
93
* The {@code cause} is not initialized, and may subsequently be
94
* initialized by a call to the
95
* {@link Throwable#initCause(java.lang.Throwable)} method.
96
*
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} object
108
* with a given {@code cause}.
109
* The {@code SQLState} is initialized
110
* to {@code null} and the vendor code is initialized to 0.
111
* The {@code reason} is initialized to {@code null} if
112
* {@code cause==null} or to {@code cause.toString()} if
113
* {@code cause!=null}.
114
*
115
* @param cause the underlying reason for this {@code SQLException} (which is saved for later retrieval by the {@code getCause()} method); may be null indicating
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} object
125
* with a given
126
* {@code reason} and {@code cause}.
127
* The {@code SQLState} is initialized to {@code null}
128
* and the vendor code is initialized to 0.
129
*
130
* @param reason a description of the exception.
131
* @param cause the underlying reason for this {@code SQLException} (which is saved for later retrieval by the {@code getCause()} 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} object
141
* with a given
142
* {@code reason}, {@code SQLState} and {@code cause}.
143
* The vendor code is initialized to 0.
144
*
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()} 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} object
157
* with a given
158
* {@code reason}, {@code SQLState}, {@code vendorCode}
159
* and {@code cause}.
160
*
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} (which is saved for later retrieval by the {@code getCause()} 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
}
174
175