Path: blob/master/src/java.sql/share/classes/java/sql/SQLNonTransientException.java
41153 views
/*1* Copyright (c) 2005, 2020, Oracle and/or its affiliates. All rights reserved.2* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.3*4* This code is free software; you can redistribute it and/or modify it5* under the terms of the GNU General Public License version 2 only, as6* published by the Free Software Foundation. Oracle designates this7* particular file as subject to the "Classpath" exception as provided8* by Oracle in the LICENSE file that accompanied this code.9*10* This code is distributed in the hope that it will be useful, but WITHOUT11* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or12* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License13* version 2 for more details (a copy is included in the LICENSE file that14* accompanied this code).15*16* You should have received a copy of the GNU General Public License version17* 2 along with this work; if not, write to the Free Software Foundation,18* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.19*20* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA21* or visit www.oracle.com if you need additional information or have any22* questions.23*/2425package java.sql;2627/**28* The subclass of {@link SQLException} thrown when an instance where a retry29* of the same operation would fail unless the cause of the {@code SQLException}30* is corrected.31*32* @since 1.633*/34public class SQLNonTransientException extends java.sql.SQLException {3536/**37* Constructs a {@code SQLNonTransientException} object.38* The {@code reason}, {@code SQLState} are initialized39* to {@code null} and the vendor code is initialized to 0.40*41* The {@code cause} is not initialized, and may subsequently be42* initialized by a call to the43* {@link Throwable#initCause(java.lang.Throwable)} method.44*45* @since 1.646*/47public SQLNonTransientException() {48super();49}5051/**52* Constructs a {@code SQLNonTransientException} object53* with a given {@code reason}. The {@code SQLState}54* is initialized to {@code null} and the vendor code is initialized55* to 0.56*57* The {@code cause} is not initialized, and may subsequently be58* initialized by a call to the59* {@link Throwable#initCause(java.lang.Throwable)} method.60*61* @param reason a description of the exception62* @since 1.663*/64public SQLNonTransientException(String reason) {65super(reason);66}6768/**69* Constructs a {@code SQLNonTransientException} object70* with a given {@code reason} and {@code SQLState}.71*72* The {@code cause} is not initialized, and may subsequently be73* initialized by a call to the74* {@link Throwable#initCause(java.lang.Throwable)} method. The vendor code75* is initialized to 0.76*77* @param reason a description of the exception78* @param SQLState an XOPEN or SQL:2003 code identifying the exception79* @since 1.680*/81public SQLNonTransientException(String reason, String SQLState) {82super(reason,SQLState);83}8485/**86* Constructs a {@code SQLNonTransientException} object87* with a given {@code reason}, {@code SQLState} and88* {@code vendorCode}.89*90* The {@code cause} is not initialized, and may subsequently be91* initialized by a call to the92* {@link Throwable#initCause(java.lang.Throwable)} method.93*94* @param reason a description of the exception95* @param SQLState an XOPEN or SQL:2003 code identifying the exception96* @param vendorCode a database vendor specific exception code97* @since 1.698*/99public SQLNonTransientException(String reason, String SQLState, int vendorCode) {100super(reason,SQLState,vendorCode);101}102103/**104* Constructs a {@code SQLNonTransientException} object105* with a given {@code cause}.106* The {@code SQLState} is initialized107* to {@code null} and the vendor code is initialized to 0.108* The {@code reason} is initialized to {@code null} if109* {@code cause==null} or to {@code cause.toString()} if110* {@code cause!=null}.111*112* @param cause the underlying reason for this {@code SQLException} (which is saved for later retrieval by the {@code getCause()} method); may be null indicating113* the cause is non-existent or unknown.114* @since 1.6115*/116public SQLNonTransientException(Throwable cause) {117super(cause);118}119120/**121* Constructs a {@code SQLNonTransientException} object122* with a given123* {@code reason} and {@code cause}.124* The {@code SQLState} is initialized to {@code null}125* and the vendor code is initialized to 0.126*127* @param reason a description of the exception.128* @param cause the underlying reason for this {@code SQLException} (which is saved for later retrieval by the {@code getCause()} method); may be null indicating129* the cause is non-existent or unknown.130* @since 1.6131*/132public SQLNonTransientException(String reason, Throwable cause) {133super(reason,cause);134135}136137/**138* Constructs a {@code SQLNonTransientException} object139* with a given140* {@code reason}, {@code SQLState} and {@code cause}.141* The vendor code is initialized to 0.142*143* @param reason a description of the exception.144* @param SQLState an XOPEN or SQL:2003 code identifying the exception145* @param cause the underlying reason for this {@code SQLException} (which is saved for later retrieval by the {@code getCause()} method); may be null indicating146* the cause is non-existent or unknown.147* @since 1.6148*/149public SQLNonTransientException(String reason, String SQLState, Throwable cause) {150super(reason,SQLState,cause);151}152153/**154* Constructs a {@code SQLNonTransientException} object155* with a given156* {@code reason}, {@code SQLState}, {@code vendorCode}157* and {@code cause}.158*159* @param reason a description of the exception160* @param SQLState an XOPEN or SQL:2003 code identifying the exception161* @param vendorCode a database vendor-specific exception code162* @param cause the underlying reason for this {@code SQLException} (which is saved for later retrieval by the {@code getCause()} method); may be null indicating163* the cause is non-existent or unknown.164* @since 1.6165*/166public SQLNonTransientException(String reason, String SQLState, int vendorCode, Throwable cause) {167super(reason,SQLState,vendorCode,cause);168}169170private static final long serialVersionUID = -9104382843534716547L;171}172173174