1/*
2 * Licensed to the Apache Software Foundation (ASF) under one or more
3 * contributor license agreements.  See the NOTICE file distributed with
4 * this work for additional information regarding copyright ownership.
5 * The ASF licenses this file to You under the Apache License, Version 2.0
6 * (the "License"); you may not use this file except in compliance with
7 * the License.  You may obtain a copy of the License at
8 *
9 *     http://www.apache.org/licenses/LICENSE-2.0
10 *
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
16 */
17
18package java.sql;
19
20/**
21 * An exception, which is subclass of SQLNonTransientException, is thrown when
22 * various the JDBC driver does not support an optional JDBC feature.
23 */
24public class SQLFeatureNotSupportedException extends SQLNonTransientException {
25
26    private static final long serialVersionUID = -1026510870282316051L;
27
28    /**
29     * Creates an SQLFeatureNotSupportedException object. The Reason string is
30     * set to null, the SQLState string is set to null and the Error Code is set
31     * to 0.
32     */
33    public SQLFeatureNotSupportedException() {
34    }
35
36    /**
37     * Creates an SQLFeatureNotSupportedException object. The Reason string is
38     * set to the given reason string, the SQLState string is set to null and
39     * the Error Code is set to 0.
40     *
41     * @param reason
42     *            the string to use as the Reason string
43     */
44    public SQLFeatureNotSupportedException(String reason) {
45        super(reason, null, 0);
46    }
47
48    /**
49     * Creates an SQLFeatureNotSupportedException object. The Reason string is
50     * set to the given reason string, the SQLState string is set to the given
51     * SQLState string and the Error Code is set to 0.
52     *
53     * @param reason
54     *            the string to use as the Reason string
55     * @param sqlState
56     *            the string to use as the SQLState string
57     */
58    public SQLFeatureNotSupportedException(String reason, String sqlState) {
59        super(reason, sqlState, 0);
60    }
61
62    /**
63     * Creates an SQLFeatureNotSupportedException object. The Reason string is
64     * set to the given reason string, the SQLState string is set to the given
65     * SQLState string and the Error Code is set to the given error code value.
66     *
67     * @param reason
68     *            the string to use as the Reason string
69     * @param sqlState
70     *            the string to use as the SQLState string
71     * @param vendorCode
72     *            the integer value for the error code
73     */
74    public SQLFeatureNotSupportedException(String reason, String sqlState,
75            int vendorCode) {
76        super(reason, sqlState, vendorCode);
77    }
78
79    /**
80     * Creates an SQLFeatureNotSupportedException object. The Reason string is
81     * set to the null if cause == null or cause.toString() if cause!=null,and
82     * the cause Throwable object is set to the given cause Throwable object.
83     *
84     * @param cause
85     *            the Throwable object for the underlying reason this
86     *            SQLException
87     */
88    public SQLFeatureNotSupportedException(Throwable cause) {
89        super(cause);
90    }
91
92    /**
93     * Creates an SQLFeatureNotSupportedException object. The Reason string is
94     * set to the given and the cause Throwable object is set to the given cause
95     * Throwable object.
96     *
97     * @param reason
98     *            the string to use as the Reason string
99     * @param cause
100     *            the Throwable object for the underlying reason this
101     *            SQLException
102     */
103    public SQLFeatureNotSupportedException(String reason, Throwable cause) {
104        super(reason, cause);
105    }
106
107    /**
108     * Creates an SQLFeatureNotSupportedException object. The Reason string is
109     * set to the given reason string, the SQLState string is set to the given
110     * SQLState string and the cause Throwable object is set to the given cause
111     * Throwable object.
112     *
113     * @param reason
114     *            the string to use as the Reason string
115     * @param sqlState
116     *            the string to use as the SQLState string
117     * @param cause
118     *            the Throwable object for the underlying reason this
119     *            SQLException
120     */
121    public SQLFeatureNotSupportedException(String reason, String sqlState,
122            Throwable cause) {
123        super(reason, sqlState, cause);
124    }
125
126    /**
127     * Creates an SQLFeatureNotSupportedException object. The Reason string is
128     * set to the given reason string, the SQLState string is set to the given
129     * SQLState string , the Error Code is set to the given error code value,
130     * and the cause Throwable object is set to the given cause Throwable
131     * object.
132     *
133     * @param reason
134     *            the string to use as the Reason string
135     * @param sqlState
136     *            the string to use as the SQLState string
137     * @param vendorCode
138     *            the integer value for the error code
139     * @param cause
140     *            the Throwable object for the underlying reason this
141     *            SQLException
142     */
143    public SQLFeatureNotSupportedException(String reason, String sqlState,
144            int vendorCode, Throwable cause) {
145        super(reason, sqlState, vendorCode, cause);
146    }
147}
148