136b3cdfbcd219d0308753d919638262c16fd34daJeremy Sharpe/* 236b3cdfbcd219d0308753d919638262c16fd34daJeremy Sharpe * Licensed to the Apache Software Foundation (ASF) under one or more 336b3cdfbcd219d0308753d919638262c16fd34daJeremy Sharpe * contributor license agreements. See the NOTICE file distributed with 436b3cdfbcd219d0308753d919638262c16fd34daJeremy Sharpe * this work for additional information regarding copyright ownership. 536b3cdfbcd219d0308753d919638262c16fd34daJeremy Sharpe * The ASF licenses this file to You under the Apache License, Version 2.0 636b3cdfbcd219d0308753d919638262c16fd34daJeremy Sharpe * (the "License"); you may not use this file except in compliance with 736b3cdfbcd219d0308753d919638262c16fd34daJeremy Sharpe * the License. You may obtain a copy of the License at 836b3cdfbcd219d0308753d919638262c16fd34daJeremy Sharpe * 936b3cdfbcd219d0308753d919638262c16fd34daJeremy Sharpe * http://www.apache.org/licenses/LICENSE-2.0 1036b3cdfbcd219d0308753d919638262c16fd34daJeremy Sharpe * 1136b3cdfbcd219d0308753d919638262c16fd34daJeremy Sharpe * Unless required by applicable law or agreed to in writing, software 1236b3cdfbcd219d0308753d919638262c16fd34daJeremy Sharpe * distributed under the License is distributed on an "AS IS" BASIS, 1336b3cdfbcd219d0308753d919638262c16fd34daJeremy Sharpe * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1436b3cdfbcd219d0308753d919638262c16fd34daJeremy Sharpe * See the License for the specific language governing permissions and 1536b3cdfbcd219d0308753d919638262c16fd34daJeremy Sharpe * limitations under the License. 1636b3cdfbcd219d0308753d919638262c16fd34daJeremy Sharpe */ 1736b3cdfbcd219d0308753d919638262c16fd34daJeremy Sharpe 1836b3cdfbcd219d0308753d919638262c16fd34daJeremy Sharpepackage java.sql; 1936b3cdfbcd219d0308753d919638262c16fd34daJeremy Sharpe 2036b3cdfbcd219d0308753d919638262c16fd34daJeremy Sharpepublic class SQLSyntaxErrorException extends SQLNonTransientException { 2136b3cdfbcd219d0308753d919638262c16fd34daJeremy Sharpe 2236b3cdfbcd219d0308753d919638262c16fd34daJeremy Sharpe private static final long serialVersionUID = -1843832610477496053L; 2336b3cdfbcd219d0308753d919638262c16fd34daJeremy Sharpe 2436b3cdfbcd219d0308753d919638262c16fd34daJeremy Sharpe /** 2536b3cdfbcd219d0308753d919638262c16fd34daJeremy Sharpe * Creates an SQLSyntaxErrorException object. The Reason string is set to 2636b3cdfbcd219d0308753d919638262c16fd34daJeremy Sharpe * null, the SQLState string is set to null and the Error Code is set to 0. 2736b3cdfbcd219d0308753d919638262c16fd34daJeremy Sharpe */ 2836b3cdfbcd219d0308753d919638262c16fd34daJeremy Sharpe public SQLSyntaxErrorException() { 2936b3cdfbcd219d0308753d919638262c16fd34daJeremy Sharpe } 3036b3cdfbcd219d0308753d919638262c16fd34daJeremy Sharpe 3136b3cdfbcd219d0308753d919638262c16fd34daJeremy Sharpe /** 3236b3cdfbcd219d0308753d919638262c16fd34daJeremy Sharpe * Creates an SQLSyntaxErrorException object. The Reason string is set to 3336b3cdfbcd219d0308753d919638262c16fd34daJeremy Sharpe * the given reason string, the SQLState string is set to null and the Error 3436b3cdfbcd219d0308753d919638262c16fd34daJeremy Sharpe * Code is set to 0. 3536b3cdfbcd219d0308753d919638262c16fd34daJeremy Sharpe * 3636b3cdfbcd219d0308753d919638262c16fd34daJeremy Sharpe * @param reason 3736b3cdfbcd219d0308753d919638262c16fd34daJeremy Sharpe * the string to use as the Reason string 3836b3cdfbcd219d0308753d919638262c16fd34daJeremy Sharpe */ 3936b3cdfbcd219d0308753d919638262c16fd34daJeremy Sharpe public SQLSyntaxErrorException(String reason) { 4036b3cdfbcd219d0308753d919638262c16fd34daJeremy Sharpe super(reason, null, 0); 4136b3cdfbcd219d0308753d919638262c16fd34daJeremy Sharpe } 4236b3cdfbcd219d0308753d919638262c16fd34daJeremy Sharpe 4336b3cdfbcd219d0308753d919638262c16fd34daJeremy Sharpe /** 4436b3cdfbcd219d0308753d919638262c16fd34daJeremy Sharpe * Creates an SQLSyntaxErrorException object. The Reason string is set to 4536b3cdfbcd219d0308753d919638262c16fd34daJeremy Sharpe * the given reason string, the SQLState string is set to the given SQLState 4636b3cdfbcd219d0308753d919638262c16fd34daJeremy Sharpe * string and the Error Code is set to 0. 4736b3cdfbcd219d0308753d919638262c16fd34daJeremy Sharpe * 4836b3cdfbcd219d0308753d919638262c16fd34daJeremy Sharpe * @param reason 4936b3cdfbcd219d0308753d919638262c16fd34daJeremy Sharpe * the string to use as the Reason string 5036b3cdfbcd219d0308753d919638262c16fd34daJeremy Sharpe * @param sqlState 5136b3cdfbcd219d0308753d919638262c16fd34daJeremy Sharpe * the string to use as the SQLState string 5236b3cdfbcd219d0308753d919638262c16fd34daJeremy Sharpe */ 5336b3cdfbcd219d0308753d919638262c16fd34daJeremy Sharpe public SQLSyntaxErrorException(String reason, String sqlState) { 5436b3cdfbcd219d0308753d919638262c16fd34daJeremy Sharpe super(reason, sqlState, 0); 5536b3cdfbcd219d0308753d919638262c16fd34daJeremy Sharpe } 5636b3cdfbcd219d0308753d919638262c16fd34daJeremy Sharpe 5736b3cdfbcd219d0308753d919638262c16fd34daJeremy Sharpe /** 5836b3cdfbcd219d0308753d919638262c16fd34daJeremy Sharpe * Creates an SQLSyntaxErrorException object. The Reason string is set to 5936b3cdfbcd219d0308753d919638262c16fd34daJeremy Sharpe * the given reason string, the SQLState string is set to the given SQLState 6036b3cdfbcd219d0308753d919638262c16fd34daJeremy Sharpe * string and the Error Code is set to the given error code value. 6136b3cdfbcd219d0308753d919638262c16fd34daJeremy Sharpe * 6236b3cdfbcd219d0308753d919638262c16fd34daJeremy Sharpe * @param reason 6336b3cdfbcd219d0308753d919638262c16fd34daJeremy Sharpe * the string to use as the Reason string 6436b3cdfbcd219d0308753d919638262c16fd34daJeremy Sharpe * @param sqlState 6536b3cdfbcd219d0308753d919638262c16fd34daJeremy Sharpe * the string to use as the SQLState string 6636b3cdfbcd219d0308753d919638262c16fd34daJeremy Sharpe * @param vendorCode 6736b3cdfbcd219d0308753d919638262c16fd34daJeremy Sharpe * the integer value for the error code 6836b3cdfbcd219d0308753d919638262c16fd34daJeremy Sharpe */ 6936b3cdfbcd219d0308753d919638262c16fd34daJeremy Sharpe public SQLSyntaxErrorException(String reason, String sqlState, 7036b3cdfbcd219d0308753d919638262c16fd34daJeremy Sharpe int vendorCode) { 7136b3cdfbcd219d0308753d919638262c16fd34daJeremy Sharpe super(reason, sqlState, vendorCode); 7236b3cdfbcd219d0308753d919638262c16fd34daJeremy Sharpe } 7336b3cdfbcd219d0308753d919638262c16fd34daJeremy Sharpe 7436b3cdfbcd219d0308753d919638262c16fd34daJeremy Sharpe /** 7536b3cdfbcd219d0308753d919638262c16fd34daJeremy Sharpe * Creates an SQLSyntaxErrorException object. The Reason string is set to 7636b3cdfbcd219d0308753d919638262c16fd34daJeremy Sharpe * the null if cause == null or cause.toString() if cause!=null,and the 7736b3cdfbcd219d0308753d919638262c16fd34daJeremy Sharpe * cause Throwable object is set to the given cause Throwable object. 7836b3cdfbcd219d0308753d919638262c16fd34daJeremy Sharpe * 7936b3cdfbcd219d0308753d919638262c16fd34daJeremy Sharpe * @param cause 8036b3cdfbcd219d0308753d919638262c16fd34daJeremy Sharpe * the Throwable object for the underlying reason this 8136b3cdfbcd219d0308753d919638262c16fd34daJeremy Sharpe * SQLException 8236b3cdfbcd219d0308753d919638262c16fd34daJeremy Sharpe */ 8336b3cdfbcd219d0308753d919638262c16fd34daJeremy Sharpe public SQLSyntaxErrorException(Throwable cause) { 8436b3cdfbcd219d0308753d919638262c16fd34daJeremy Sharpe super(cause); 8536b3cdfbcd219d0308753d919638262c16fd34daJeremy Sharpe } 8636b3cdfbcd219d0308753d919638262c16fd34daJeremy Sharpe 8736b3cdfbcd219d0308753d919638262c16fd34daJeremy Sharpe /** 8836b3cdfbcd219d0308753d919638262c16fd34daJeremy Sharpe * Creates an SQLSyntaxErrorException object. The Reason string is set to 8936b3cdfbcd219d0308753d919638262c16fd34daJeremy Sharpe * the given and the cause Throwable object is set to the given cause 9036b3cdfbcd219d0308753d919638262c16fd34daJeremy Sharpe * Throwable object. 9136b3cdfbcd219d0308753d919638262c16fd34daJeremy Sharpe * 9236b3cdfbcd219d0308753d919638262c16fd34daJeremy Sharpe * @param reason 9336b3cdfbcd219d0308753d919638262c16fd34daJeremy Sharpe * the string to use as the Reason string 9436b3cdfbcd219d0308753d919638262c16fd34daJeremy Sharpe * @param cause 9536b3cdfbcd219d0308753d919638262c16fd34daJeremy Sharpe * the Throwable object for the underlying reason this 9636b3cdfbcd219d0308753d919638262c16fd34daJeremy Sharpe * SQLException 9736b3cdfbcd219d0308753d919638262c16fd34daJeremy Sharpe */ 9836b3cdfbcd219d0308753d919638262c16fd34daJeremy Sharpe public SQLSyntaxErrorException(String reason, Throwable cause) { 9936b3cdfbcd219d0308753d919638262c16fd34daJeremy Sharpe super(reason, cause); 10036b3cdfbcd219d0308753d919638262c16fd34daJeremy Sharpe } 10136b3cdfbcd219d0308753d919638262c16fd34daJeremy Sharpe 10236b3cdfbcd219d0308753d919638262c16fd34daJeremy Sharpe /** 10336b3cdfbcd219d0308753d919638262c16fd34daJeremy Sharpe * Creates an SQLSyntaxErrorException object. The Reason string is set to 10436b3cdfbcd219d0308753d919638262c16fd34daJeremy Sharpe * the given reason string, the SQLState string is set to the given SQLState 10536b3cdfbcd219d0308753d919638262c16fd34daJeremy Sharpe * string and the cause Throwable object is set to the given cause Throwable 10636b3cdfbcd219d0308753d919638262c16fd34daJeremy Sharpe * object. 10736b3cdfbcd219d0308753d919638262c16fd34daJeremy Sharpe * 10836b3cdfbcd219d0308753d919638262c16fd34daJeremy Sharpe * @param reason 10936b3cdfbcd219d0308753d919638262c16fd34daJeremy Sharpe * the string to use as the Reason string 11036b3cdfbcd219d0308753d919638262c16fd34daJeremy Sharpe * @param sqlState 11136b3cdfbcd219d0308753d919638262c16fd34daJeremy Sharpe * the string to use as the SQLState string 11236b3cdfbcd219d0308753d919638262c16fd34daJeremy Sharpe * @param cause 11336b3cdfbcd219d0308753d919638262c16fd34daJeremy Sharpe * the Throwable object for the underlying reason this 11436b3cdfbcd219d0308753d919638262c16fd34daJeremy Sharpe * SQLException 11536b3cdfbcd219d0308753d919638262c16fd34daJeremy Sharpe */ 11636b3cdfbcd219d0308753d919638262c16fd34daJeremy Sharpe public SQLSyntaxErrorException(String reason, String sqlState, 11736b3cdfbcd219d0308753d919638262c16fd34daJeremy Sharpe Throwable cause) { 11836b3cdfbcd219d0308753d919638262c16fd34daJeremy Sharpe super(reason, sqlState, cause); 11936b3cdfbcd219d0308753d919638262c16fd34daJeremy Sharpe } 12036b3cdfbcd219d0308753d919638262c16fd34daJeremy Sharpe 12136b3cdfbcd219d0308753d919638262c16fd34daJeremy Sharpe /** 12236b3cdfbcd219d0308753d919638262c16fd34daJeremy Sharpe * Creates an SQLSyntaxErrorException object. The Reason string is set to 12336b3cdfbcd219d0308753d919638262c16fd34daJeremy Sharpe * the given reason string, the SQLState string is set to the given SQLState 12436b3cdfbcd219d0308753d919638262c16fd34daJeremy Sharpe * string , the Error Code is set to the given error code value, and the 12536b3cdfbcd219d0308753d919638262c16fd34daJeremy Sharpe * cause Throwable object is set to the given cause Throwable object. 12636b3cdfbcd219d0308753d919638262c16fd34daJeremy Sharpe * 12736b3cdfbcd219d0308753d919638262c16fd34daJeremy Sharpe * @param reason 12836b3cdfbcd219d0308753d919638262c16fd34daJeremy Sharpe * the string to use as the Reason string 12936b3cdfbcd219d0308753d919638262c16fd34daJeremy Sharpe * @param sqlState 13036b3cdfbcd219d0308753d919638262c16fd34daJeremy Sharpe * the string to use as the SQLState string 13136b3cdfbcd219d0308753d919638262c16fd34daJeremy Sharpe * @param vendorCode 13236b3cdfbcd219d0308753d919638262c16fd34daJeremy Sharpe * the integer value for the error code 13336b3cdfbcd219d0308753d919638262c16fd34daJeremy Sharpe * @param cause 13436b3cdfbcd219d0308753d919638262c16fd34daJeremy Sharpe * the Throwable object for the underlying reason this 13536b3cdfbcd219d0308753d919638262c16fd34daJeremy Sharpe * SQLException 13636b3cdfbcd219d0308753d919638262c16fd34daJeremy Sharpe */ 13736b3cdfbcd219d0308753d919638262c16fd34daJeremy Sharpe public SQLSyntaxErrorException(String reason, String sqlState, 13836b3cdfbcd219d0308753d919638262c16fd34daJeremy Sharpe int vendorCode, Throwable cause) { 13936b3cdfbcd219d0308753d919638262c16fd34daJeremy Sharpe super(reason, sqlState, vendorCode, cause); 14036b3cdfbcd219d0308753d919638262c16fd34daJeremy Sharpe } 14132c2297a959b72abdb18743f0519e1d8b7c7ea88Elliott Hughes} 142