Path: blob/aarch64-shenandoah-jdk8u272-b10/jdk/src/share/classes/java/sql/SQLTransientException.java
38829 views
/*1* Copyright (c) 2005, 2013, 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} is thrown in situations where a29* previously failed operation might be able to succeed when the operation is30* retried without any intervention by application-level functionality.31*<p>32*33* @since 1.634*/35public class SQLTransientException extends java.sql.SQLException {3637/**38* Constructs a <code>SQLTransientException</code> object.39* The <code>reason</code>, <code>SQLState</code> are initialized40* to <code>null</code> and the vendor code is initialized to 0.41*42* The <code>cause</code> is not initialized, and may subsequently be43* initialized by a call to the44* {@link Throwable#initCause(java.lang.Throwable)} method.45* <p>46* @since 1.647*/48public SQLTransientException() {49super();50}5152/**53* Constructs a <code>SQLTransientException</code> object54* with a given <code>reason</code>. The <code>SQLState</code>55* is initialized to <code>null</code> and the vendor code is initialized56* to 0.57*58* The <code>cause</code> is not initialized, and may subsequently be59* initialized by a call to the60* {@link Throwable#initCause(java.lang.Throwable)} method.61* <p>62* @param reason a description of the exception63* @since 1.664*/65public SQLTransientException(String reason) {66super(reason);67}6869/**70* Constructs a <code>SQLTransientException</code> object71* with a given <code>reason</code> and <code>SQLState</code>.72*73* The <code>cause</code> is not initialized, and may subsequently be74* initialized by a call to the75* {@link Throwable#initCause(java.lang.Throwable)} method. The vendor code76* is initialized to 0.77* <p>78* @param reason a description of the exception79* @param SQLState an XOPEN or SQL:2003 code identifying the exception80* @since 1.681*/82public SQLTransientException(String reason, String SQLState) {83super(reason,SQLState);84}8586/**87* Constructs a <code>SQLTransientException</code> object88* with a given <code>reason</code>, <code>SQLState</code> and89* <code>vendorCode</code>.90*91* The <code>cause</code> is not initialized, and may subsequently be92* initialized by a call to the93* {@link Throwable#initCause(java.lang.Throwable)} method.94* <p>95* @param reason a description of the exception96* @param SQLState an XOPEN or SQL:2003 code identifying the exception97* @param vendorCode a database vendor specific exception code98* @since 1.699*/100public SQLTransientException(String reason, String SQLState, int vendorCode) {101super(reason,SQLState,vendorCode);102}103104/**105* Constructs a <code>SQLTransientException</code> object106* with a given <code>cause</code>.107* The <code>SQLState</code> is initialized108* to <code>null</code> and the vendor code is initialized to 0.109* The <code>reason</code> is initialized to <code>null</code> if110* <code>cause==null</code> or to <code>cause.toString()</code> if111* <code>cause!=null</code>.112* <p>113* @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 indicating114* the cause is non-existent or unknown.115* @since 1.6116*/117public SQLTransientException(Throwable cause) {118super(cause);119}120121/**122* Constructs a <code>SQLTransientException</code> object123* with a given124* <code>reason</code> and <code>cause</code>.125* The <code>SQLState</code> is initialized to <code>null</code>126* and the vendor code is initialized to 0.127* <p>128* @param reason a description of the exception.129* @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 indicating130* the cause is non-existent or unknown.131* @since 1.6132*/133public SQLTransientException(String reason, Throwable cause) {134super(reason,cause);135}136137/**138* Constructs a <code>SQLTransientException</code> object139* with a given140* <code>reason</code>, <code>SQLState</code> and <code>cause</code>.141* The vendor code is initialized to 0.142* <p>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</code> (which is saved for later retrieval by the <code>getCause()</code> method); may be null indicating146* the cause is non-existent or unknown.147* @since 1.6148*/149public SQLTransientException(String reason, String SQLState, Throwable cause) {150super(reason,SQLState,cause);151}152153/**154* Constructs a <code>SQLTransientException</code> object155* with a given156* <code>reason</code>, <code>SQLState</code>, <code>vendorCode</code>157* and <code>cause</code>.158* <p>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</code> (which is saved for later retrieval by the <code>getCause()</code> method); may be null indicating163* the cause is non-existent or unknown.164* @since 1.6165*/166public SQLTransientException(String reason, String SQLState, int vendorCode, Throwable cause) {167super(reason,SQLState,vendorCode,cause);168}169170private static final long serialVersionUID = -9042733978262274539L;171}172173174