jdk/src/share/classes/java/sql/SQLRecoverableException.java
author malenkov
Tue, 29 Oct 2013 17:01:06 +0400
changeset 21278 ef8a3a2a72f2
parent 5506 202f599c92aa
child 23010 6dadb192ad81
permissions -rw-r--r--
8022746: List of spelling errors in API doc Reviewed-by: alexsch, smarks
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     1
/*
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2
diff changeset
     2
 * Copyright (c) 2006, Oracle and/or its affiliates. All rights reserved.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
90ce3da70b43 Initial load
duke
parents:
diff changeset
     4
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
90ce3da70b43 Initial load
duke
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2
diff changeset
     7
 * published by the Free Software Foundation.  Oracle designates this
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     8
 * particular file as subject to the "Classpath" exception as provided
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2
diff changeset
     9
 * by Oracle in the LICENSE file that accompanied this code.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    10
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    11
 * This code is distributed in the hope that it will be useful, but WITHOUT
90ce3da70b43 Initial load
duke
parents:
diff changeset
    12
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
90ce3da70b43 Initial load
duke
parents:
diff changeset
    13
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
90ce3da70b43 Initial load
duke
parents:
diff changeset
    14
 * version 2 for more details (a copy is included in the LICENSE file that
90ce3da70b43 Initial load
duke
parents:
diff changeset
    15
 * accompanied this code).
90ce3da70b43 Initial load
duke
parents:
diff changeset
    16
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    17
 * You should have received a copy of the GNU General Public License version
90ce3da70b43 Initial load
duke
parents:
diff changeset
    18
 * 2 along with this work; if not, write to the Free Software Foundation,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    19
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    20
 *
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2
diff changeset
    21
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2
diff changeset
    22
 * or visit www.oracle.com if you need additional information or have any
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2
diff changeset
    23
 * questions.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    24
 */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    25
90ce3da70b43 Initial load
duke
parents:
diff changeset
    26
package java.sql;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    27
90ce3da70b43 Initial load
duke
parents:
diff changeset
    28
/**
90ce3da70b43 Initial load
duke
parents:
diff changeset
    29
 * The subclass of {@link SQLException} thrown in situations where a
90ce3da70b43 Initial load
duke
parents:
diff changeset
    30
 * previously failed operation might be able to succeed if the application performs
90ce3da70b43 Initial load
duke
parents:
diff changeset
    31
 *  some recovery steps and retries the entire transaction or in the case of a
90ce3da70b43 Initial load
duke
parents:
diff changeset
    32
 * distributed transaction, the transaction branch.  At a minimum,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    33
 * the recovery operation must include closing the current connection and getting
90ce3da70b43 Initial load
duke
parents:
diff changeset
    34
 * a new connection.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    35
 *<p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    36
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    37
 * @since 1.6
90ce3da70b43 Initial load
duke
parents:
diff changeset
    38
 */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    39
public class SQLRecoverableException extends java.sql.SQLException {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    40
90ce3da70b43 Initial load
duke
parents:
diff changeset
    41
        /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
    42
         * Constructs a <code>SQLRecoverableException</code> object.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    43
         * The <code>reason</code>, <code>SQLState</code> are initialized
90ce3da70b43 Initial load
duke
parents:
diff changeset
    44
         * to <code>null</code> and the vendor code is initialized to 0.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    45
         *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    46
         * The <code>cause</code> is not initialized, and may subsequently be
90ce3da70b43 Initial load
duke
parents:
diff changeset
    47
         * initialized by a call to the
90ce3da70b43 Initial load
duke
parents:
diff changeset
    48
         * {@link Throwable#initCause(java.lang.Throwable)} method.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    49
         * <p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    50
         * @since 1.6
90ce3da70b43 Initial load
duke
parents:
diff changeset
    51
        */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    52
        public SQLRecoverableException() {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    53
                super();
90ce3da70b43 Initial load
duke
parents:
diff changeset
    54
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
    55
90ce3da70b43 Initial load
duke
parents:
diff changeset
    56
        /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
    57
         * Constructs a <code>SQLRecoverableException</code> object
90ce3da70b43 Initial load
duke
parents:
diff changeset
    58
         *  with a given <code>reason</code>. The <code>SQLState</code>
21278
ef8a3a2a72f2 8022746: List of spelling errors in API doc
malenkov
parents: 5506
diff changeset
    59
         * is initialized to <code>null</code> and the vendor code is initialized
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    60
         * to 0.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    61
         *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    62
         * The <code>cause</code> is not initialized, and may subsequently be
90ce3da70b43 Initial load
duke
parents:
diff changeset
    63
         * initialized by a call to the
90ce3da70b43 Initial load
duke
parents:
diff changeset
    64
         * {@link Throwable#initCause(java.lang.Throwable)} method.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    65
         * <p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    66
         * @param reason a description of the exception
90ce3da70b43 Initial load
duke
parents:
diff changeset
    67
         * @since 1.6
90ce3da70b43 Initial load
duke
parents:
diff changeset
    68
         */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    69
        public SQLRecoverableException(String reason) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    70
                super(reason);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    71
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
    72
90ce3da70b43 Initial load
duke
parents:
diff changeset
    73
        /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
    74
         * Constructs a <code>SQLRecoverableException</code> object
90ce3da70b43 Initial load
duke
parents:
diff changeset
    75
         * with a given <code>reason</code> and <code>SQLState</code>.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    76
         *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    77
         * The <code>cause</code> is not initialized, and may subsequently be
90ce3da70b43 Initial load
duke
parents:
diff changeset
    78
         * initialized by a call to the
90ce3da70b43 Initial load
duke
parents:
diff changeset
    79
         * {@link Throwable#initCause(java.lang.Throwable)} method. The vendor code
90ce3da70b43 Initial load
duke
parents:
diff changeset
    80
         * is initialized to 0.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    81
         * <p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    82
         * @param reason a description of the exception
90ce3da70b43 Initial load
duke
parents:
diff changeset
    83
         * @param SQLState an XOPEN or SQL:2003 code identifying the exception
90ce3da70b43 Initial load
duke
parents:
diff changeset
    84
         * @since 1.6
90ce3da70b43 Initial load
duke
parents:
diff changeset
    85
         */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    86
        public SQLRecoverableException(String reason, String SQLState) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    87
                super(reason, SQLState);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    88
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
    89
90ce3da70b43 Initial load
duke
parents:
diff changeset
    90
        /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
    91
         * Constructs a <code>SQLRecoverableException</code> object
90ce3da70b43 Initial load
duke
parents:
diff changeset
    92
         *  with a given <code>reason</code>, <code>SQLState</code>  and
90ce3da70b43 Initial load
duke
parents:
diff changeset
    93
         * <code>vendorCode</code>.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    94
         *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    95
         * The <code>cause</code> is not initialized, and may subsequently be
90ce3da70b43 Initial load
duke
parents:
diff changeset
    96
         * initialized by a call to the
90ce3da70b43 Initial load
duke
parents:
diff changeset
    97
         * {@link Throwable#initCause(java.lang.Throwable)} method.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    98
         * <p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    99
         * @param reason a description of the exception
90ce3da70b43 Initial load
duke
parents:
diff changeset
   100
         * @param SQLState an XOPEN or SQL:2003 code identifying the exception
90ce3da70b43 Initial load
duke
parents:
diff changeset
   101
         * @param vendorCode a database vendor specific exception code
90ce3da70b43 Initial load
duke
parents:
diff changeset
   102
         * @since 1.6
90ce3da70b43 Initial load
duke
parents:
diff changeset
   103
         */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   104
        public SQLRecoverableException(String reason, String SQLState, int vendorCode) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   105
                super(reason, SQLState, vendorCode);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   106
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   107
90ce3da70b43 Initial load
duke
parents:
diff changeset
   108
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   109
     * Constructs a <code>SQLRecoverableException</code> object
90ce3da70b43 Initial load
duke
parents:
diff changeset
   110
     * with a given  <code>cause</code>.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   111
     * The <code>SQLState</code> is initialized
90ce3da70b43 Initial load
duke
parents:
diff changeset
   112
     * to <code>null</code> and the vendor code is initialized to 0.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   113
     * The <code>reason</code>  is initialized to <code>null</code> if
90ce3da70b43 Initial load
duke
parents:
diff changeset
   114
     * <code>cause==null</code> or to <code>cause.toString()</code> if
90ce3da70b43 Initial load
duke
parents:
diff changeset
   115
     * <code>cause!=null</code>.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   116
     * <p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   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
90ce3da70b43 Initial load
duke
parents:
diff changeset
   118
     *     the cause is non-existent or unknown.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   119
     * @since 1.6
90ce3da70b43 Initial load
duke
parents:
diff changeset
   120
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   121
    public SQLRecoverableException(Throwable cause) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   122
        super(cause);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   123
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   124
90ce3da70b43 Initial load
duke
parents:
diff changeset
   125
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   126
     * Constructs a <code>SQLRecoverableException</code> object
90ce3da70b43 Initial load
duke
parents:
diff changeset
   127
     * with a given
90ce3da70b43 Initial load
duke
parents:
diff changeset
   128
     * <code>reason</code> and  <code>cause</code>.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   129
     * The <code>SQLState</code> is  initialized to <code>null</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   130
     * and the vendor code is initialized to 0.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   131
     * <p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   132
     * @param reason a description of the exception.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   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
90ce3da70b43 Initial load
duke
parents:
diff changeset
   134
     *     the cause is non-existent or unknown.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   135
     * @since 1.6
90ce3da70b43 Initial load
duke
parents:
diff changeset
   136
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   137
    public SQLRecoverableException(String reason, Throwable cause) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   138
        super(reason, cause);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   139
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   140
90ce3da70b43 Initial load
duke
parents:
diff changeset
   141
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   142
     * Constructs a <code>SQLRecoverableException</code> object
90ce3da70b43 Initial load
duke
parents:
diff changeset
   143
     * with a given
90ce3da70b43 Initial load
duke
parents:
diff changeset
   144
     * <code>reason</code>, <code>SQLState</code> and  <code>cause</code>.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   145
     * The vendor code is initialized to 0.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   146
     * <p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   147
     * @param reason a description of the exception.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   148
     * @param SQLState an XOPEN or SQL:2003 code identifying the exception
90ce3da70b43 Initial load
duke
parents:
diff changeset
   149
     * @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
90ce3da70b43 Initial load
duke
parents:
diff changeset
   150
     *     the cause is non-existent or unknown.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   151
     * @since 1.6
90ce3da70b43 Initial load
duke
parents:
diff changeset
   152
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   153
    public SQLRecoverableException(String reason, String SQLState, Throwable cause) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   154
        super(reason, SQLState, cause);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   155
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   156
90ce3da70b43 Initial load
duke
parents:
diff changeset
   157
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   158
     *  Constructs a <code>SQLRecoverableException</code> object
90ce3da70b43 Initial load
duke
parents:
diff changeset
   159
     * with a given
90ce3da70b43 Initial load
duke
parents:
diff changeset
   160
     * <code>reason</code>, <code>SQLState</code>, <code>vendorCode</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   161
     * and  <code>cause</code>.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   162
     * <p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   163
     * @param reason a description of the exception
90ce3da70b43 Initial load
duke
parents:
diff changeset
   164
     * @param SQLState an XOPEN or SQL:2003 code identifying the exception
90ce3da70b43 Initial load
duke
parents:
diff changeset
   165
     * @param vendorCode a database vendor-specific exception code
90ce3da70b43 Initial load
duke
parents:
diff changeset
   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
90ce3da70b43 Initial load
duke
parents:
diff changeset
   167
     *     the cause is non-existent or unknown.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   168
     * @since 1.6
90ce3da70b43 Initial load
duke
parents:
diff changeset
   169
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   170
    public SQLRecoverableException(String reason, String SQLState, int vendorCode, Throwable cause) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   171
        super(reason, SQLState, vendorCode, cause);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   172
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   173
90ce3da70b43 Initial load
duke
parents:
diff changeset
   174
   private static final long serialVersionUID = -4144386502923131579L;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   175
}