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