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
20public class SQLTimeoutException extends SQLTransientException {
21
22    private static final long serialVersionUID = -4487171280562520262L;
23
24    /**
25     * Creates an SQLTimeoutException object. The Reason string is set to null,
26     * the SQLState string is set to null and the Error Code is set to 0.
27     */
28    public SQLTimeoutException() {
29    }
30
31    /**
32     * Creates an SQLTimeoutException object. The Reason string is set to the
33     * given reason string, the SQLState string is set to null and the Error
34     * Code is set to 0.
35     *
36     * @param reason
37     *            the string to use as the Reason string
38     */
39    public SQLTimeoutException(String reason) {
40        super(reason, null, 0);
41    }
42
43    /**
44     * Creates an SQLTimeoutException object. The Reason string is set to the
45     * given reason string, the SQLState string is set to the given SQLState
46     * string and the Error Code is set to 0.
47     *
48     * @param reason
49     *            the string to use as the Reason string
50     * @param sqlState
51     *            the string to use as the SQLState string
52     */
53    public SQLTimeoutException(String reason, String sqlState) {
54        super(reason, sqlState, 0);
55    }
56
57    /**
58     * Creates an SQLTimeoutException object. The Reason string is set to the
59     * given reason string, the SQLState string is set to the given SQLState
60     * string and the Error Code is set to the given error code value.
61     *
62     * @param reason
63     *            the string to use as the Reason string
64     * @param sqlState
65     *            the string to use as the SQLState string
66     * @param vendorCode
67     *            the integer value for the error code
68     */
69    public SQLTimeoutException(String reason, String sqlState, int vendorCode) {
70        super(reason, sqlState, vendorCode);
71    }
72
73    /**
74     * Creates an SQLTimeoutException object. The Reason string is set to the
75     * null if cause == null or cause.toString() if cause!=null,and the cause
76     * Throwable object is set to the given cause Throwable object.
77     *
78     * @param cause
79     *            the Throwable object for the underlying reason this
80     *            SQLException
81     */
82    public SQLTimeoutException(Throwable cause) {
83        super(cause);
84    }
85
86    /**
87     * Creates an SQLTimeoutException object. The Reason string is set to the
88     * given and the cause Throwable object is set to the given cause Throwable
89     * object.
90     *
91     * @param reason
92     *            the string to use as the Reason string
93     * @param cause
94     *            the Throwable object for the underlying reason this
95     *            SQLException
96     */
97    public SQLTimeoutException(String reason, Throwable cause) {
98        super(reason, cause);
99    }
100
101    /**
102     * Creates an SQLTimeoutException object. The Reason string is set to the
103     * given reason string, the SQLState string is set to the given SQLState
104     * string and the cause Throwable object is set to the given cause Throwable
105     * object.
106     *
107     * @param reason
108     *            the string to use as the Reason string
109     * @param sqlState
110     *            the string to use as the SQLState string
111     * @param cause
112     *            the Throwable object for the underlying reason this
113     *            SQLException
114     */
115    public SQLTimeoutException(String reason, String sqlState, Throwable cause) {
116        super(reason, sqlState, cause);
117    }
118
119    /**
120     * Creates an SQLTimeoutException object. The Reason string is set to the
121     * given reason string, the SQLState string is set to the given SQLState
122     * string , the Error Code is set to the given error code value, and the
123     * cause Throwable object is set to the given cause Throwable object.
124     *
125     * @param reason
126     *            the string to use as the Reason string
127     * @param sqlState
128     *            the string to use as the SQLState string
129     * @param vendorCode
130     *            the integer value for the error code
131     * @param cause
132     *            the Throwable object for the underlying reason this
133     *            SQLException
134     */
135    public SQLTimeoutException(String reason, String sqlState, int vendorCode,
136            Throwable cause) {
137        super(reason, sqlState, vendorCode, cause);
138    }
139}
140