1 /*
2  * Copyright (c) 2005, 2006, 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 is '<i>0A</i>'
30  * ( the value is 'zero' A).
31  * This indicates that the JDBC driver does not support an optional JDBC feature.
32  * Optional JDBC features can fall into the fallowing categories:
33  *<p>
34  *<UL>
35  *<LI>no support for an optional feature
36  *<LI>no support for an optional overloaded method
37  *<LI>no support for an optional mode for a method.  The mode for a method is
38  *determined based on constants passed as parameter values to a method
39  *</UL>
40  *
41  * @since 1.6
42  */
43 public class SQLFeatureNotSupportedException extends SQLNonTransientException {
44 
45         /**
46          * Constructs a <code>SQLFeatureNotSupportedException</code> object.
47          *  The <code>reason</code>, <code>SQLState</code> are initialized
48          * to <code>null</code> and the vendor code is initialized to 0.
49          *
50          * The <code>cause</code> is not initialized, and may subsequently be
51          * initialized by a call to the
52          * {@link Throwable#initCause(java.lang.Throwable)} method.
53          * <p>
54          * @since 1.6
55          */
SQLFeatureNotSupportedException()56         public SQLFeatureNotSupportedException() {
57                 super();
58         }
59 
60         /**
61          * Constructs a <code>SQLFeatureNotSupportedException</code> object
62          * with a given <code>reason</code>. The <code>SQLState</code>
63          * is initialized to <code>null</code> and the vender code is initialized
64          * to 0.
65          *
66          * The <code>cause</code> is not initialized, and may subsequently be
67          * initialized by a call to the
68          * {@link Throwable#initCause(java.lang.Throwable)} method.
69          * <p>
70          * @param reason a description of the exception
71          * @since 1.6
72          */
SQLFeatureNotSupportedException(String reason)73         public SQLFeatureNotSupportedException(String reason) {
74                 super(reason);
75         }
76 
77         /**
78          * Constructs a <code>SQLFeatureNotSupportedException</code> object
79          * with a given <code>reason</code> and <code>SQLState</code>.
80          *
81          * The <code>cause</code> is not initialized, and may subsequently be
82          * initialized by a call to the
83          * {@link Throwable#initCause(java.lang.Throwable)} method. The vendor code
84          * is initialized to 0.
85          * <p>
86          * @param reason a description of the exception
87          * @param SQLState an XOPEN or SQL:2003 code identifying the exception
88          * @since 1.6
89          */
SQLFeatureNotSupportedException(String reason, String SQLState)90         public SQLFeatureNotSupportedException(String reason, String SQLState) {
91                 super(reason,SQLState);
92         }
93 
94         /**
95          * Constructs a <code>SQLFeatureNotSupportedException</code> object
96          *  with a given <code>reason</code>, <code>SQLState</code>  and
97          * <code>vendorCode</code>.
98          *
99          * The <code>cause</code> is not initialized, and may subsequently be
100          * initialized by a call to the
101          * {@link Throwable#initCause(java.lang.Throwable)} method.
102          * <p>
103          * @param reason a description of the exception
104          * @param SQLState an XOPEN or SQL:2003 code identifying the exception
105          * @param vendorCode a database vendor specific exception code
106          * @since 1.6
107          */
SQLFeatureNotSupportedException(String reason, String SQLState, int vendorCode)108         public SQLFeatureNotSupportedException(String reason, String SQLState, int vendorCode) {
109                 super(reason,SQLState,vendorCode);
110         }
111 
112     /**
113      * Constructs a <code>SQLFeatureNotSupportedException</code> object
114      *   with a given  <code>cause</code>.
115      * The <code>SQLState</code> is initialized
116      * to <code>null</code> and the vendor code is initialized to 0.
117      * The <code>reason</code>  is initialized to <code>null</code> if
118      * <code>cause==null</code> or to <code>cause.toString()</code> if
119      * <code>cause!=null</code>.
120      * <p>
121      * @param cause the underlying reason for this <code>SQLException</code> (which is saved for later retrieval bythe <code>getCause()</code> method); may be null indicating
122      *     the cause is non-existent or unknown.
123      * @since 1.6
124      */
SQLFeatureNotSupportedException(Throwable cause)125     public SQLFeatureNotSupportedException(Throwable cause) {
126         super(cause);
127     }
128 
129     /**
130      * Constructs a <code>SQLFeatureNotSupportedException</code> object
131      * with a given
132      * <code>reason</code> and  <code>cause</code>.
133      * The <code>SQLState</code> is  initialized to <code>null</code>
134      * and the vendor code is initialized to 0.
135      * <p>
136      * @param reason a description of the exception.
137      * @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
138      *     the cause is non-existent or unknown.
139      * @since 1.6
140      */
SQLFeatureNotSupportedException(String reason, Throwable cause)141     public SQLFeatureNotSupportedException(String reason, Throwable cause) {
142         super(reason,cause);
143     }
144 
145     /**
146      * Constructs a <code>SQLFeatureNotSupportedException</code> object
147      * with a given
148      * <code>reason</code>, <code>SQLState</code> and  <code>cause</code>.
149      * The vendor code is initialized to 0.
150      * <p>
151      * @param reason a description of the exception.
152      * @param SQLState an XOPEN or SQL:2003 code identifying the exception
153      * @param cause the (which is saved for later retrieval by the <code>getCause()</code> method); may be null indicating
154      *     the cause is non-existent or unknown.
155      * @since 1.6
156      */
SQLFeatureNotSupportedException(String reason, String SQLState, Throwable cause)157     public SQLFeatureNotSupportedException(String reason, String SQLState, Throwable cause) {
158         super(reason,SQLState,cause);
159     }
160 
161     /**
162      *  Constructs a <code>SQLFeatureNotSupportedException</code> object
163      * with a given
164      * <code>reason</code>, <code>SQLState</code>, <code>vendorCode</code>
165      * and  <code>cause</code>.
166      * <p>
167      * @param reason a description of the exception
168      * @param SQLState an XOPEN or SQL:2003 code identifying the exception
169      * @param vendorCode a database vendor-specific exception code
170      * @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
171      *     the cause is non-existent or unknown.
172      * @since 1.6
173      */
SQLFeatureNotSupportedException(String reason, String SQLState, int vendorCode, Throwable cause)174     public SQLFeatureNotSupportedException(String reason, String SQLState, int vendorCode, Throwable cause) {
175         super(reason,SQLState,vendorCode,cause);
176     }
177 
178     private static final long serialVersionUID = -1026510870282316051L;
179 }
180