1/* 2 * Licensed to the Apache Software Foundation (ASF) under one or more 3 * contributor license agreements. See the NOTICE file distributed with 4 * this work for additional information regarding copyright ownership. 5 * The ASF licenses this file to You under the Apache License, Version 2.0 6 * (the "License"); you may not use this file except in compliance with 7 * the License. You may obtain a copy of the License at 8 * 9 * http://www.apache.org/licenses/LICENSE-2.0 10 * 11 * Unless required by applicable law or agreed to in writing, software 12 * distributed under the License is distributed on an "AS IS" BASIS, 13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 * See the License for the specific language governing permissions and 15 * limitations under the License. 16 */ 17 18package java.sql; 19 20/** 21 * An exception, which is subclass of SQLNonTransientException, is thrown when 22 * the authorization credentials presented during connection establishment are 23 * not valid. 24 */ 25public class SQLInvalidAuthorizationSpecException extends 26 SQLNonTransientException { 27 28 private static final long serialVersionUID = -64105250450891498L; 29 30 /** 31 * Creates an SQLInvalidAuthorizationSpecException object. The Reason string 32 * is set to null, the SQLState string is set to null and the Error Code is 33 * set to 0. 34 */ 35 public SQLInvalidAuthorizationSpecException() { 36 } 37 38 /** 39 * Creates an SQLInvalidAuthorizationSpecException object. The Reason string 40 * is set to the given reason string, the SQLState string is set to null and 41 * the Error Code is set to 0. 42 * 43 * @param reason 44 * the string to use as the Reason string 45 */ 46 public SQLInvalidAuthorizationSpecException(String reason) { 47 super(reason, null, 0); 48 } 49 50 /** 51 * Creates an SQLInvalidAuthorizationSpecException object. The Reason string 52 * is set to the given reason string, the SQLState string is set to the 53 * given SQLState string and the Error Code is set to 0. 54 * 55 * @param reason 56 * the string to use as the Reason string 57 * @param sqlState 58 * the string to use as the SQLState string 59 */ 60 public SQLInvalidAuthorizationSpecException(String reason, String sqlState) { 61 super(reason, sqlState, 0); 62 } 63 64 /** 65 * Creates an SQLInvalidAuthorizationSpecException object. The Reason string 66 * is set to the given reason string, the SQLState string is set to the 67 * given SQLState string and the Error Code is set to the given error code 68 * value. 69 * 70 * @param reason 71 * the string to use as the Reason string 72 * @param sqlState 73 * the string to use as the SQLState string 74 * @param vendorCode 75 * the integer value for the error code 76 */ 77 public SQLInvalidAuthorizationSpecException(String reason, String sqlState, 78 int vendorCode) { 79 super(reason, sqlState, vendorCode); 80 } 81 82 /** 83 * Creates an SQLInvalidAuthorizationSpecException object. The Reason string 84 * is set to the null if cause == null or cause.toString() if 85 * cause!=null,and the cause Throwable object is set to the given cause 86 * Throwable object. 87 * 88 * @param cause 89 * the Throwable object for the underlying reason this 90 * SQLException 91 */ 92 public SQLInvalidAuthorizationSpecException(Throwable cause) { 93 super(cause); 94 } 95 96 /** 97 * Creates an SQLInvalidAuthorizationSpecException object. The Reason string 98 * is set to the given and the cause Throwable object is set to the given 99 * cause Throwable object. 100 * 101 * @param reason 102 * the string to use as the Reason string 103 * @param cause 104 * the Throwable object for the underlying reason this 105 * SQLException 106 */ 107 public SQLInvalidAuthorizationSpecException(String reason, Throwable cause) { 108 super(reason, cause); 109 } 110 111 /** 112 * Creates an SQLInvalidAuthorizationSpecException object. The Reason string 113 * is set to the given reason string, the SQLState string is set to the 114 * given SQLState string and the cause Throwable object is set to the given 115 * cause Throwable object. 116 * 117 * @param reason 118 * the string to use as the Reason string 119 * @param sqlState 120 * the string to use as the SQLState string 121 * @param cause 122 * the Throwable object for the underlying reason this 123 * SQLException 124 */ 125 public SQLInvalidAuthorizationSpecException(String reason, String sqlState, 126 Throwable cause) { 127 super(reason, sqlState, cause); 128 } 129 130 /** 131 * Creates an SQLInvalidAuthorizationSpecException object. The Reason string 132 * is set to the given reason string, the SQLState string is set to the 133 * given SQLState string , the Error Code is set to the given error code 134 * value, and the cause Throwable object is set to the given cause Throwable 135 * object. 136 * 137 * @param reason 138 * the string to use as the Reason string 139 * @param sqlState 140 * the string to use as the SQLState string 141 * @param vendorCode 142 * the integer value for the error code 143 * @param cause 144 * the Throwable object for the underlying reason this 145 * SQLException 146 */ 147 public SQLInvalidAuthorizationSpecException(String reason, String sqlState, 148 int vendorCode, Throwable cause) { 149 super(reason, sqlState, vendorCode, cause); 150 } 151} 152