Path: blob/aarch64-shenandoah-jdk8u272-b10/jdk/src/share/classes/java/sql/SQLTransientConnectionException.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} for the SQLState class29* value '<i>08</i>', or under vendor-specified conditions. This indicates30* that the connection operation that failed might be able to succeed if31* the operation is retried without any application-level changes.32* <p>33* Please consult your driver vendor documentation for the vendor-specified34* conditions for which this <code>Exception</code> may be thrown.35* @since 1.636*/37public class SQLTransientConnectionException extends java.sql.SQLTransientException {3839/**40* Constructs a <code>SQLTransientConnectionException</code> object.41* The <code>reason</code>, <code>SQLState</code> are initialized42* to <code>null</code> and the vendor code is initialized to 0.43*44* The <code>cause</code> is not initialized, and may subsequently be45* initialized by a call to the46* {@link Throwable#initCause(java.lang.Throwable)} method.47* <p>48* @since 1.649*/50public SQLTransientConnectionException() {51super();52}5354/**55* Constructs a <code>SQLTransientConnectionException</code> object56* with a given <code>reason</code>. The <code>SQLState</code>57* is initialized to <code>null</code> and the vendor code is initialized58* to 0.59*60* The <code>cause</code> is not initialized, and may subsequently be61* initialized by a call to the62* {@link Throwable#initCause(java.lang.Throwable)} method.63* <p>64* @param reason a description of the exception65* @since 1.666*/67public SQLTransientConnectionException(String reason) {68super(reason);69}7071/**72* Constructs a <code>SQLTransientConnectionException</code> object73* with a given <code>reason</code> and <code>SQLState</code>.74*75* The <code>cause</code> is not initialized, and may subsequently be76* initialized by a call to the77* {@link Throwable#initCause(java.lang.Throwable)} method. The vendor code78* is initialized to 0.79* <p>80* @param reason a description of the exception81* @param SQLState an XOPEN or SQL:2003 code identifying the exception82* @since 1.683*/84public SQLTransientConnectionException(String reason, String SQLState) {85super(reason,SQLState);86}8788/**89* Constructs a <code>SQLTransientConnectionException</code> object90* with a given <code>reason</code>, <code>SQLState</code> and91* <code>vendorCode</code>.92*93* The <code>cause</code> is not initialized, and may subsequently be94* initialized by a call to the95* {@link Throwable#initCause(java.lang.Throwable)} method.96* <p>97* @param reason a description of the exception98* @param SQLState an XOPEN or SQL:2003 code identifying the exception99* @param vendorCode a database vendor specific exception code100* @since 1.6101*/102public SQLTransientConnectionException(String reason, String SQLState, int vendorCode) {103super(reason,SQLState,vendorCode);104}105106/**107* Constructs a <code>SQLTransientConnectionException</code> object108* with a given <code>cause</code>.109* The <code>SQLState</code> is initialized110* to <code>null</code> and the vendor code is initialized to 0.111* The <code>reason</code> is initialized to <code>null</code> if112* <code>cause==null</code> or to <code>cause.toString()</code> if113* <code>cause!=null</code>.114* <p>115* @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 indicating116* the cause is non-existent or unknown.117* @since 1.6118*/119public SQLTransientConnectionException(Throwable cause) {120super(cause);121}122123/**124* Constructs a <code>SQLTransientConnectionException</code> object125* with a given126* <code>reason</code> and <code>cause</code>.127* The <code>SQLState</code> is initialized to <code>null</code>128* and the vendor code is initialized to 0.129* <p>130* @param reason a description of the exception.131* @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 indicating132* the cause is non-existent or unknown.133* @since 1.6134*/135public SQLTransientConnectionException(String reason, Throwable cause) {136super(reason,cause);137}138139/**140* Constructs a <code>SQLTransientConnectionException</code> object141* with a given142* <code>reason</code>, <code>SQLState</code> and <code>cause</code>.143* The vendor code is initialized to 0.144* <p>145* @param reason a description of the exception.146* @param SQLState an XOPEN or SQL:2003 code identifying the exception147* @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 indicating148* the cause is non-existent or unknown.149* @since 1.6150*/151public SQLTransientConnectionException(String reason, String SQLState, Throwable cause) {152super(reason,SQLState,cause);153}154155/**156* Constructs a <code>SQLTransientConnectionException</code> object157* with a given158* <code>reason</code>, <code>SQLState</code>, <code>vendorCode</code>159* and <code>cause</code>.160* <p>161* @param reason a description of the exception162* @param SQLState an XOPEN or SQL:2003 code identifying the exception163* @param vendorCode a database vendor-specific exception code164* @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 indicating165* the cause is non-existent or unknown.166* @since 1.6167*/168public SQLTransientConnectionException(String reason, String SQLState, int vendorCode, Throwable cause) {169super(reason,SQLState,vendorCode,cause);170}171172private static final long serialVersionUID = -2520155553543391200L;173}174175176