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 SQLTransientConnectionException extends SQLTransientException {
2136b3cdfbcd219d0308753d919638262c16fd34daJeremy Sharpe
2236b3cdfbcd219d0308753d919638262c16fd34daJeremy Sharpe    private static final long serialVersionUID = -2520155553543391200L;
2336b3cdfbcd219d0308753d919638262c16fd34daJeremy Sharpe
2436b3cdfbcd219d0308753d919638262c16fd34daJeremy Sharpe    /**
2536b3cdfbcd219d0308753d919638262c16fd34daJeremy Sharpe     * Creates an SQLTransientConnectionException object. The Reason string is
2636b3cdfbcd219d0308753d919638262c16fd34daJeremy Sharpe     * set to null, the SQLState string is set to null and the Error Code is set
2736b3cdfbcd219d0308753d919638262c16fd34daJeremy Sharpe     * to 0.
2836b3cdfbcd219d0308753d919638262c16fd34daJeremy Sharpe     */
2936b3cdfbcd219d0308753d919638262c16fd34daJeremy Sharpe    public SQLTransientConnectionException() {
3036b3cdfbcd219d0308753d919638262c16fd34daJeremy Sharpe    }
3136b3cdfbcd219d0308753d919638262c16fd34daJeremy Sharpe
3236b3cdfbcd219d0308753d919638262c16fd34daJeremy Sharpe    /**
3336b3cdfbcd219d0308753d919638262c16fd34daJeremy Sharpe     * Creates an SQLTransientConnectionException object. The Reason string is
3436b3cdfbcd219d0308753d919638262c16fd34daJeremy Sharpe     * set to the given reason string, the SQLState string is set to null and
3536b3cdfbcd219d0308753d919638262c16fd34daJeremy Sharpe     * the Error Code is set to 0.
3636b3cdfbcd219d0308753d919638262c16fd34daJeremy Sharpe     *
3736b3cdfbcd219d0308753d919638262c16fd34daJeremy Sharpe     * @param reason
3836b3cdfbcd219d0308753d919638262c16fd34daJeremy Sharpe     *            the string to use as the Reason string
3936b3cdfbcd219d0308753d919638262c16fd34daJeremy Sharpe     */
4036b3cdfbcd219d0308753d919638262c16fd34daJeremy Sharpe    public SQLTransientConnectionException(String reason) {
4136b3cdfbcd219d0308753d919638262c16fd34daJeremy Sharpe        super(reason, null, 0);
4236b3cdfbcd219d0308753d919638262c16fd34daJeremy Sharpe    }
4336b3cdfbcd219d0308753d919638262c16fd34daJeremy Sharpe
4436b3cdfbcd219d0308753d919638262c16fd34daJeremy Sharpe    /**
4536b3cdfbcd219d0308753d919638262c16fd34daJeremy Sharpe     * Creates an SQLTransientConnectionException object. The Reason string is
4636b3cdfbcd219d0308753d919638262c16fd34daJeremy Sharpe     * set to the given reason string, the SQLState string is set to the given
4736b3cdfbcd219d0308753d919638262c16fd34daJeremy Sharpe     * SQLState string and the Error Code is set to 0.
4836b3cdfbcd219d0308753d919638262c16fd34daJeremy Sharpe     *
4936b3cdfbcd219d0308753d919638262c16fd34daJeremy Sharpe     * @param reason
5036b3cdfbcd219d0308753d919638262c16fd34daJeremy Sharpe     *            the string to use as the Reason string
5136b3cdfbcd219d0308753d919638262c16fd34daJeremy Sharpe     * @param sqlState
5236b3cdfbcd219d0308753d919638262c16fd34daJeremy Sharpe     *            the string to use as the SQLState string
5336b3cdfbcd219d0308753d919638262c16fd34daJeremy Sharpe     */
5436b3cdfbcd219d0308753d919638262c16fd34daJeremy Sharpe    public SQLTransientConnectionException(String reason, String sqlState) {
5536b3cdfbcd219d0308753d919638262c16fd34daJeremy Sharpe        super(reason, sqlState, 0);
5636b3cdfbcd219d0308753d919638262c16fd34daJeremy Sharpe    }
5736b3cdfbcd219d0308753d919638262c16fd34daJeremy Sharpe
5836b3cdfbcd219d0308753d919638262c16fd34daJeremy Sharpe    /**
5936b3cdfbcd219d0308753d919638262c16fd34daJeremy Sharpe     * Creates an SQLTransientConnectionException object. The Reason string is
6036b3cdfbcd219d0308753d919638262c16fd34daJeremy Sharpe     * set to the given reason string, the SQLState string is set to the given
6136b3cdfbcd219d0308753d919638262c16fd34daJeremy Sharpe     * SQLState string and the Error Code is set to the given error code value.
6236b3cdfbcd219d0308753d919638262c16fd34daJeremy Sharpe     *
6336b3cdfbcd219d0308753d919638262c16fd34daJeremy Sharpe     * @param reason
6436b3cdfbcd219d0308753d919638262c16fd34daJeremy Sharpe     *            the string to use as the Reason string
6536b3cdfbcd219d0308753d919638262c16fd34daJeremy Sharpe     * @param sqlState
6636b3cdfbcd219d0308753d919638262c16fd34daJeremy Sharpe     *            the string to use as the SQLState string
6736b3cdfbcd219d0308753d919638262c16fd34daJeremy Sharpe     * @param vendorCode
6836b3cdfbcd219d0308753d919638262c16fd34daJeremy Sharpe     *            the integer value for the error code
6936b3cdfbcd219d0308753d919638262c16fd34daJeremy Sharpe     */
7036b3cdfbcd219d0308753d919638262c16fd34daJeremy Sharpe    public SQLTransientConnectionException(String reason, String sqlState,
7136b3cdfbcd219d0308753d919638262c16fd34daJeremy Sharpe            int vendorCode) {
7236b3cdfbcd219d0308753d919638262c16fd34daJeremy Sharpe        super(reason, sqlState, vendorCode);
7336b3cdfbcd219d0308753d919638262c16fd34daJeremy Sharpe    }
7436b3cdfbcd219d0308753d919638262c16fd34daJeremy Sharpe
7536b3cdfbcd219d0308753d919638262c16fd34daJeremy Sharpe    /**
7636b3cdfbcd219d0308753d919638262c16fd34daJeremy Sharpe     * Creates an SQLTransientConnectionException object. The Reason string is
7736b3cdfbcd219d0308753d919638262c16fd34daJeremy Sharpe     * set to the null if cause == null or cause.toString() if cause!=null,and
7836b3cdfbcd219d0308753d919638262c16fd34daJeremy Sharpe     * the cause Throwable object is set to the given cause Throwable object.
7936b3cdfbcd219d0308753d919638262c16fd34daJeremy Sharpe     *
8036b3cdfbcd219d0308753d919638262c16fd34daJeremy Sharpe     * @param cause
8136b3cdfbcd219d0308753d919638262c16fd34daJeremy Sharpe     *            the Throwable object for the underlying reason this
8236b3cdfbcd219d0308753d919638262c16fd34daJeremy Sharpe     *            SQLException
8336b3cdfbcd219d0308753d919638262c16fd34daJeremy Sharpe     */
8436b3cdfbcd219d0308753d919638262c16fd34daJeremy Sharpe    public SQLTransientConnectionException(Throwable cause) {
8536b3cdfbcd219d0308753d919638262c16fd34daJeremy Sharpe        super(cause);
8636b3cdfbcd219d0308753d919638262c16fd34daJeremy Sharpe    }
8736b3cdfbcd219d0308753d919638262c16fd34daJeremy Sharpe
8836b3cdfbcd219d0308753d919638262c16fd34daJeremy Sharpe    /**
8936b3cdfbcd219d0308753d919638262c16fd34daJeremy Sharpe     * Creates an SQLTransientConnectionException object. The Reason string is
9036b3cdfbcd219d0308753d919638262c16fd34daJeremy Sharpe     * set to the given and the cause Throwable object is set to the given cause
9136b3cdfbcd219d0308753d919638262c16fd34daJeremy Sharpe     * Throwable object.
9236b3cdfbcd219d0308753d919638262c16fd34daJeremy Sharpe     *
9336b3cdfbcd219d0308753d919638262c16fd34daJeremy Sharpe     * @param reason
9436b3cdfbcd219d0308753d919638262c16fd34daJeremy Sharpe     *            the string to use as the Reason string
9536b3cdfbcd219d0308753d919638262c16fd34daJeremy Sharpe     * @param cause
9636b3cdfbcd219d0308753d919638262c16fd34daJeremy Sharpe     *            the Throwable object for the underlying reason this
9736b3cdfbcd219d0308753d919638262c16fd34daJeremy Sharpe     *            SQLException
9836b3cdfbcd219d0308753d919638262c16fd34daJeremy Sharpe     */
9936b3cdfbcd219d0308753d919638262c16fd34daJeremy Sharpe    public SQLTransientConnectionException(String reason, Throwable cause) {
10036b3cdfbcd219d0308753d919638262c16fd34daJeremy Sharpe        super(reason, cause);
10136b3cdfbcd219d0308753d919638262c16fd34daJeremy Sharpe    }
10236b3cdfbcd219d0308753d919638262c16fd34daJeremy Sharpe
10336b3cdfbcd219d0308753d919638262c16fd34daJeremy Sharpe    /**
10436b3cdfbcd219d0308753d919638262c16fd34daJeremy Sharpe     * Creates an SQLTransientConnectionException object. The Reason string is
10536b3cdfbcd219d0308753d919638262c16fd34daJeremy Sharpe     * set to the given reason string, the SQLState string is set to the given
10636b3cdfbcd219d0308753d919638262c16fd34daJeremy Sharpe     * SQLState string and the cause Throwable object is set to the given cause
10736b3cdfbcd219d0308753d919638262c16fd34daJeremy Sharpe     * Throwable object.
10836b3cdfbcd219d0308753d919638262c16fd34daJeremy Sharpe     *
10936b3cdfbcd219d0308753d919638262c16fd34daJeremy Sharpe     * @param reason
11036b3cdfbcd219d0308753d919638262c16fd34daJeremy Sharpe     *            the string to use as the Reason string
11136b3cdfbcd219d0308753d919638262c16fd34daJeremy Sharpe     * @param sqlState
11236b3cdfbcd219d0308753d919638262c16fd34daJeremy Sharpe     *            the string to use as the SQLState string
11336b3cdfbcd219d0308753d919638262c16fd34daJeremy Sharpe     * @param cause
11436b3cdfbcd219d0308753d919638262c16fd34daJeremy Sharpe     *            the Throwable object for the underlying reason this
11536b3cdfbcd219d0308753d919638262c16fd34daJeremy Sharpe     *            SQLException
11636b3cdfbcd219d0308753d919638262c16fd34daJeremy Sharpe     */
11736b3cdfbcd219d0308753d919638262c16fd34daJeremy Sharpe    public SQLTransientConnectionException(String reason, String sqlState,
11836b3cdfbcd219d0308753d919638262c16fd34daJeremy Sharpe            Throwable cause) {
11936b3cdfbcd219d0308753d919638262c16fd34daJeremy Sharpe        super(reason, sqlState, cause);
12036b3cdfbcd219d0308753d919638262c16fd34daJeremy Sharpe    }
12136b3cdfbcd219d0308753d919638262c16fd34daJeremy Sharpe
12236b3cdfbcd219d0308753d919638262c16fd34daJeremy Sharpe    /**
12336b3cdfbcd219d0308753d919638262c16fd34daJeremy Sharpe     * Creates an SQLTransientConnectionException object. The Reason string is
12436b3cdfbcd219d0308753d919638262c16fd34daJeremy Sharpe     * set to the given reason string, the SQLState string is set to the given
12536b3cdfbcd219d0308753d919638262c16fd34daJeremy Sharpe     * SQLState string , the Error Code is set to the given error code value,
12636b3cdfbcd219d0308753d919638262c16fd34daJeremy Sharpe     * and the cause Throwable object is set to the given cause Throwable
12736b3cdfbcd219d0308753d919638262c16fd34daJeremy Sharpe     * object.
12832c2297a959b72abdb18743f0519e1d8b7c7ea88Elliott Hughes     *
12936b3cdfbcd219d0308753d919638262c16fd34daJeremy Sharpe     * @param reason
13036b3cdfbcd219d0308753d919638262c16fd34daJeremy Sharpe     *            the string to use as the Reason string
13136b3cdfbcd219d0308753d919638262c16fd34daJeremy Sharpe     * @param sqlState
13236b3cdfbcd219d0308753d919638262c16fd34daJeremy Sharpe     *            the string to use as the SQLState string
13336b3cdfbcd219d0308753d919638262c16fd34daJeremy Sharpe     * @param vendorCode
13436b3cdfbcd219d0308753d919638262c16fd34daJeremy Sharpe     *            the integer value for the error code
13536b3cdfbcd219d0308753d919638262c16fd34daJeremy Sharpe     * @param cause
13636b3cdfbcd219d0308753d919638262c16fd34daJeremy Sharpe     *            the Throwable object for the underlying reason this
13736b3cdfbcd219d0308753d919638262c16fd34daJeremy Sharpe     *            SQLException
13836b3cdfbcd219d0308753d919638262c16fd34daJeremy Sharpe     */
13936b3cdfbcd219d0308753d919638262c16fd34daJeremy Sharpe    public SQLTransientConnectionException(String reason, String sqlState,
14036b3cdfbcd219d0308753d919638262c16fd34daJeremy Sharpe            int vendorCode, Throwable cause) {
14136b3cdfbcd219d0308753d919638262c16fd34daJeremy Sharpe        super(reason, sqlState, vendorCode, cause);
14236b3cdfbcd219d0308753d919638262c16fd34daJeremy Sharpe    }
14332c2297a959b72abdb18743f0519e1d8b7c7ea88Elliott Hughes}
144