src/java.sql/share/classes/java/sql/SQLClientInfoException.java
author psadhukhan
Fri, 09 Nov 2018 09:29:43 +0530
changeset 52543 3853631e6a07
parent 47216 71c04702a3d5
child 58338 faf791c5a710
permissions -rw-r--r--
8213181: Updation of ProblemList.txt for removal of passing swing test Reviewed-by: serb
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
package java.sql;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    26
90ce3da70b43 Initial load
duke
parents:
diff changeset
    27
import java.util.Map;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    28
90ce3da70b43 Initial load
duke
parents:
diff changeset
    29
/**
90ce3da70b43 Initial load
duke
parents:
diff changeset
    30
 * The subclass of {@link SQLException} is thrown when one or more client info properties
90ce3da70b43 Initial load
duke
parents:
diff changeset
    31
 * could not be set on a <code>Connection</code>.  In addition to the information provided
90ce3da70b43 Initial load
duke
parents:
diff changeset
    32
 * by <code>SQLException</code>, a <code>SQLClientInfoException</code> provides a list of client info
90ce3da70b43 Initial load
duke
parents:
diff changeset
    33
 * properties that were not set.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    34
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    35
 * Some databases do not allow multiple client info properties to be set
90ce3da70b43 Initial load
duke
parents:
diff changeset
    36
 * atomically.  For those databases, it is possible that some of the client
90ce3da70b43 Initial load
duke
parents:
diff changeset
    37
 * info properties had been set even though the <code>Connection.setClientInfo</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    38
 * method threw an exception.  An application can use the <code>getFailedProperties </code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    39
 * method to retrieve a list of client info properties that were not set.  The
90ce3da70b43 Initial load
duke
parents:
diff changeset
    40
 * properties are identified by passing a
90ce3da70b43 Initial load
duke
parents:
diff changeset
    41
 * <code>Map&lt;String,ClientInfoStatus&gt;</code> to
90ce3da70b43 Initial load
duke
parents:
diff changeset
    42
 * the appropriate <code>SQLClientInfoException</code> constructor.
23590
ffd8b0b70511 8038493: Tidy warnings cleanup for java.sql
yan
parents: 5506
diff changeset
    43
 *
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    44
 * @see ClientInfoStatus
90ce3da70b43 Initial load
duke
parents:
diff changeset
    45
 * @see Connection#setClientInfo
90ce3da70b43 Initial load
duke
parents:
diff changeset
    46
 * @since 1.6
90ce3da70b43 Initial load
duke
parents:
diff changeset
    47
 */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    48
public class SQLClientInfoException extends SQLException {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    49
90ce3da70b43 Initial load
duke
parents:
diff changeset
    50
90ce3da70b43 Initial load
duke
parents:
diff changeset
    51
90ce3da70b43 Initial load
duke
parents:
diff changeset
    52
90ce3da70b43 Initial load
duke
parents:
diff changeset
    53
        private Map<String, ClientInfoStatus>   failedProperties;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    54
90ce3da70b43 Initial load
duke
parents:
diff changeset
    55
        /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
    56
     * Constructs a <code>SQLClientInfoException</code>  Object.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    57
     * The <code>reason</code>,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    58
     * <code>SQLState</code>, and failedProperties list are initialized to
90ce3da70b43 Initial load
duke
parents:
diff changeset
    59
     * <code> null</code> and the vendor code is initialized to 0.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    60
     * The <code>cause</code> is not initialized, and may subsequently be
90ce3da70b43 Initial load
duke
parents:
diff changeset
    61
     * initialized by a call to the
90ce3da70b43 Initial load
duke
parents:
diff changeset
    62
     * {@link Throwable#initCause(java.lang.Throwable)} method.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    63
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    64
     * @since 1.6
90ce3da70b43 Initial load
duke
parents:
diff changeset
    65
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    66
        public SQLClientInfoException() {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    67
90ce3da70b43 Initial load
duke
parents:
diff changeset
    68
                this.failedProperties = null;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    69
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
    70
90ce3da70b43 Initial load
duke
parents:
diff changeset
    71
        /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
    72
     * Constructs a <code>SQLClientInfoException</code> object initialized with a
90ce3da70b43 Initial load
duke
parents:
diff changeset
    73
     * given <code>failedProperties</code>.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    74
     * The <code>reason</code> and <code>SQLState</code> are initialized
90ce3da70b43 Initial load
duke
parents:
diff changeset
    75
     * to <code>null</code> and the vendor code is initialized to 0.
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.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    80
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    81
     * @param failedProperties          A Map containing the property values that could not
90ce3da70b43 Initial load
duke
parents:
diff changeset
    82
     *                                  be set.  The keys in the Map
90ce3da70b43 Initial load
duke
parents:
diff changeset
    83
     *                                  contain the names of the client info
90ce3da70b43 Initial load
duke
parents:
diff changeset
    84
     *                                  properties that could not be set and
90ce3da70b43 Initial load
duke
parents:
diff changeset
    85
     *                                  the values contain one of the reason codes
90ce3da70b43 Initial load
duke
parents:
diff changeset
    86
     *                                  defined in <code>ClientInfoStatus</code>
23590
ffd8b0b70511 8038493: Tidy warnings cleanup for java.sql
yan
parents: 5506
diff changeset
    87
     *
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    88
     * @since 1.6
90ce3da70b43 Initial load
duke
parents:
diff changeset
    89
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    90
        public SQLClientInfoException(Map<String, ClientInfoStatus> failedProperties) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    91
90ce3da70b43 Initial load
duke
parents:
diff changeset
    92
                this.failedProperties = failedProperties;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    93
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
    94
90ce3da70b43 Initial load
duke
parents:
diff changeset
    95
        /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
    96
     * Constructs a <code>SQLClientInfoException</code> object initialized with
90ce3da70b43 Initial load
duke
parents:
diff changeset
    97
     * a given <code>cause</code> and <code>failedProperties</code>.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    98
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    99
     * The <code>reason</code>  is initialized to <code>null</code> if
90ce3da70b43 Initial load
duke
parents:
diff changeset
   100
     * <code>cause==null</code> or to <code>cause.toString()</code> if
90ce3da70b43 Initial load
duke
parents:
diff changeset
   101
     * <code>cause!=null</code> and the vendor code is initialized to 0.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   102
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   103
     * @param failedProperties          A Map containing the property values that could not
90ce3da70b43 Initial load
duke
parents:
diff changeset
   104
     *                                  be set.  The keys in the Map
90ce3da70b43 Initial load
duke
parents:
diff changeset
   105
     *                                  contain the names of the client info
90ce3da70b43 Initial load
duke
parents:
diff changeset
   106
     *                                  properties that could not be set and
90ce3da70b43 Initial load
duke
parents:
diff changeset
   107
     *                                  the values contain one of the reason codes
90ce3da70b43 Initial load
duke
parents:
diff changeset
   108
     *                                  defined in <code>ClientInfoStatus</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   109
     * @param cause                                     the (which is saved for later retrieval by the <code>getCause()</code> method); may be null indicating
90ce3da70b43 Initial load
duke
parents:
diff changeset
   110
     *     the cause is non-existent or unknown.
23590
ffd8b0b70511 8038493: Tidy warnings cleanup for java.sql
yan
parents: 5506
diff changeset
   111
     *
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   112
     * @since 1.6
90ce3da70b43 Initial load
duke
parents:
diff changeset
   113
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   114
        public SQLClientInfoException(Map<String, ClientInfoStatus> failedProperties,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   115
                                                           Throwable cause) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   116
90ce3da70b43 Initial load
duke
parents:
diff changeset
   117
                super(cause != null?cause.toString():null);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   118
                initCause(cause);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   119
                this.failedProperties = failedProperties;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   120
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   121
90ce3da70b43 Initial load
duke
parents:
diff changeset
   122
        /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   123
     * Constructs a <code>SQLClientInfoException</code> object initialized with a
90ce3da70b43 Initial load
duke
parents:
diff changeset
   124
     * given <code>reason</code> and <code>failedProperties</code>.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   125
     * The <code>SQLState</code> is initialized
90ce3da70b43 Initial load
duke
parents:
diff changeset
   126
     * to <code>null</code> and the vendor code is initialized to 0.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   127
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   128
     * The <code>cause</code> is not initialized, and may subsequently be
90ce3da70b43 Initial load
duke
parents:
diff changeset
   129
     * initialized by a call to the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   130
     * {@link Throwable#initCause(java.lang.Throwable)} method.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   131
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   132
     * @param reason                            a description of the exception
90ce3da70b43 Initial load
duke
parents:
diff changeset
   133
     * @param failedProperties          A Map containing the property values that could not
90ce3da70b43 Initial load
duke
parents:
diff changeset
   134
     *                                  be set.  The keys in the Map
90ce3da70b43 Initial load
duke
parents:
diff changeset
   135
     *                                  contain the names of the client info
90ce3da70b43 Initial load
duke
parents:
diff changeset
   136
     *                                  properties that could not be set and
90ce3da70b43 Initial load
duke
parents:
diff changeset
   137
     *                                  the values contain one of the reason codes
90ce3da70b43 Initial load
duke
parents:
diff changeset
   138
     *                                  defined in <code>ClientInfoStatus</code>
23590
ffd8b0b70511 8038493: Tidy warnings cleanup for java.sql
yan
parents: 5506
diff changeset
   139
     *
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   140
     * @since 1.6
90ce3da70b43 Initial load
duke
parents:
diff changeset
   141
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   142
        public SQLClientInfoException(String reason,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   143
                Map<String, ClientInfoStatus> failedProperties) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   144
90ce3da70b43 Initial load
duke
parents:
diff changeset
   145
                super(reason);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   146
                this.failedProperties = failedProperties;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   147
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   148
90ce3da70b43 Initial load
duke
parents:
diff changeset
   149
        /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   150
     * Constructs a <code>SQLClientInfoException</code> object initialized with a
90ce3da70b43 Initial load
duke
parents:
diff changeset
   151
     * given <code>reason</code>, <code>cause</code> and
90ce3da70b43 Initial load
duke
parents:
diff changeset
   152
     * <code>failedProperties</code>.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   153
     * The  <code>SQLState</code> is initialized
90ce3da70b43 Initial load
duke
parents:
diff changeset
   154
     * to <code>null</code> and the vendor code is initialized to 0.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   155
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   156
     * @param reason                            a description of the exception
90ce3da70b43 Initial load
duke
parents:
diff changeset
   157
     * @param failedProperties          A Map containing the property values that could not
90ce3da70b43 Initial load
duke
parents:
diff changeset
   158
     *                                  be set.  The keys in the Map
90ce3da70b43 Initial load
duke
parents:
diff changeset
   159
     *                                  contain the names of the client info
90ce3da70b43 Initial load
duke
parents:
diff changeset
   160
     *                                  properties that could not be set and
90ce3da70b43 Initial load
duke
parents:
diff changeset
   161
     *                                  the values contain one of the reason codes
90ce3da70b43 Initial load
duke
parents:
diff changeset
   162
     *                                  defined in <code>ClientInfoStatus</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   163
     * @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
   164
     *     the cause is non-existent or unknown.
23590
ffd8b0b70511 8038493: Tidy warnings cleanup for java.sql
yan
parents: 5506
diff changeset
   165
     *
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   166
     * @since 1.6
90ce3da70b43 Initial load
duke
parents:
diff changeset
   167
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   168
        public SQLClientInfoException(String reason,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   169
                                                           Map<String, ClientInfoStatus> failedProperties,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   170
                                                           Throwable cause) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   171
90ce3da70b43 Initial load
duke
parents:
diff changeset
   172
                super(reason);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   173
                initCause(cause);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   174
                this.failedProperties = failedProperties;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   175
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   176
90ce3da70b43 Initial load
duke
parents:
diff changeset
   177
        /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   178
     * Constructs a <code>SQLClientInfoException</code> object initialized with a
90ce3da70b43 Initial load
duke
parents:
diff changeset
   179
     * given  <code>reason</code>, <code>SQLState</code>  and
90ce3da70b43 Initial load
duke
parents:
diff changeset
   180
     * <code>failedProperties</code>.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   181
     * The <code>cause</code> is not initialized, and may subsequently be
90ce3da70b43 Initial load
duke
parents:
diff changeset
   182
     * initialized by a call to the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   183
     * {@link Throwable#initCause(java.lang.Throwable)} method. The vendor code
90ce3da70b43 Initial load
duke
parents:
diff changeset
   184
     * is initialized to 0.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   185
     *
23590
ffd8b0b70511 8038493: Tidy warnings cleanup for java.sql
yan
parents: 5506
diff changeset
   186
     * @param reason                    a description of the exception
ffd8b0b70511 8038493: Tidy warnings cleanup for java.sql
yan
parents: 5506
diff changeset
   187
     * @param SQLState                  an XOPEN or SQL:2003 code identifying the exception
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   188
     * @param failedProperties          A Map containing the property values that could not
90ce3da70b43 Initial load
duke
parents:
diff changeset
   189
     *                                  be set.  The keys in the Map
90ce3da70b43 Initial load
duke
parents:
diff changeset
   190
     *                                  contain the names of the client info
90ce3da70b43 Initial load
duke
parents:
diff changeset
   191
     *                                  properties that could not be set and
90ce3da70b43 Initial load
duke
parents:
diff changeset
   192
     *                                  the values contain one of the reason codes
90ce3da70b43 Initial load
duke
parents:
diff changeset
   193
     *                                  defined in <code>ClientInfoStatus</code>
23590
ffd8b0b70511 8038493: Tidy warnings cleanup for java.sql
yan
parents: 5506
diff changeset
   194
     *
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   195
     * @since 1.6
90ce3da70b43 Initial load
duke
parents:
diff changeset
   196
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   197
        public SQLClientInfoException(String reason,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   198
                                                           String SQLState,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   199
                                                           Map<String, ClientInfoStatus> failedProperties) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   200
90ce3da70b43 Initial load
duke
parents:
diff changeset
   201
                super(reason, SQLState);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   202
                this.failedProperties = failedProperties;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   203
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   204
90ce3da70b43 Initial load
duke
parents:
diff changeset
   205
        /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   206
     * Constructs a <code>SQLClientInfoException</code> object initialized with a
90ce3da70b43 Initial load
duke
parents:
diff changeset
   207
     * given  <code>reason</code>, <code>SQLState</code>, <code>cause</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   208
     * and <code>failedProperties</code>.  The vendor code is initialized to 0.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   209
     *
23590
ffd8b0b70511 8038493: Tidy warnings cleanup for java.sql
yan
parents: 5506
diff changeset
   210
     * @param reason                    a description of the exception
ffd8b0b70511 8038493: Tidy warnings cleanup for java.sql
yan
parents: 5506
diff changeset
   211
     * @param SQLState                  an XOPEN or SQL:2003 code identifying the exception
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   212
     * @param failedProperties          A Map containing the property values that could not
90ce3da70b43 Initial load
duke
parents:
diff changeset
   213
     *                                  be set.  The keys in the Map
90ce3da70b43 Initial load
duke
parents:
diff changeset
   214
     *                                  contain the names of the client info
90ce3da70b43 Initial load
duke
parents:
diff changeset
   215
     *                                  properties that could not be set and
90ce3da70b43 Initial load
duke
parents:
diff changeset
   216
     *                                  the values contain one of the reason codes
90ce3da70b43 Initial load
duke
parents:
diff changeset
   217
     *                                  defined in <code>ClientInfoStatus</code>
23590
ffd8b0b70511 8038493: Tidy warnings cleanup for java.sql
yan
parents: 5506
diff changeset
   218
     * @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
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   219
     *     the cause is non-existent or unknown.
23590
ffd8b0b70511 8038493: Tidy warnings cleanup for java.sql
yan
parents: 5506
diff changeset
   220
     *
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   221
     * @since 1.6
90ce3da70b43 Initial load
duke
parents:
diff changeset
   222
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   223
        public SQLClientInfoException(String reason,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   224
                                                           String SQLState,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   225
                                                           Map<String, ClientInfoStatus> failedProperties,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   226
                                                           Throwable cause) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   227
90ce3da70b43 Initial load
duke
parents:
diff changeset
   228
                super(reason, SQLState);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   229
                initCause(cause);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   230
                this.failedProperties = failedProperties;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   231
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   232
90ce3da70b43 Initial load
duke
parents:
diff changeset
   233
        /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   234
     * Constructs a <code>SQLClientInfoException</code> object initialized with a
90ce3da70b43 Initial load
duke
parents:
diff changeset
   235
     * given  <code>reason</code>, <code>SQLState</code>,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   236
     * <code>vendorCode</code>  and <code>failedProperties</code>.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   237
     * The <code>cause</code> is not initialized, and may subsequently be
90ce3da70b43 Initial load
duke
parents:
diff changeset
   238
     * initialized by a call to the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   239
     * {@link Throwable#initCause(java.lang.Throwable)} method.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   240
     *
23590
ffd8b0b70511 8038493: Tidy warnings cleanup for java.sql
yan
parents: 5506
diff changeset
   241
     * @param reason                    a description of the exception
ffd8b0b70511 8038493: Tidy warnings cleanup for java.sql
yan
parents: 5506
diff changeset
   242
     * @param SQLState                  an XOPEN or SQL:2003 code identifying the exception
ffd8b0b70511 8038493: Tidy warnings cleanup for java.sql
yan
parents: 5506
diff changeset
   243
     * @param vendorCode                a database vendor-specific exception code
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   244
     * @param failedProperties          A Map containing the property values that could not
90ce3da70b43 Initial load
duke
parents:
diff changeset
   245
     *                                  be set.  The keys in the Map
90ce3da70b43 Initial load
duke
parents:
diff changeset
   246
     *                                  contain the names of the client info
90ce3da70b43 Initial load
duke
parents:
diff changeset
   247
     *                                  properties that could not be set and
90ce3da70b43 Initial load
duke
parents:
diff changeset
   248
     *                                  the values contain one of the reason codes
90ce3da70b43 Initial load
duke
parents:
diff changeset
   249
     *                                  defined in <code>ClientInfoStatus</code>
23590
ffd8b0b70511 8038493: Tidy warnings cleanup for java.sql
yan
parents: 5506
diff changeset
   250
     *
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   251
     * @since 1.6
90ce3da70b43 Initial load
duke
parents:
diff changeset
   252
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   253
        public SQLClientInfoException(String reason,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   254
                                                           String SQLState,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   255
                                                           int vendorCode,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   256
                                                           Map<String, ClientInfoStatus> failedProperties) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   257
90ce3da70b43 Initial load
duke
parents:
diff changeset
   258
                super(reason, SQLState, vendorCode);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   259
                this.failedProperties = failedProperties;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   260
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   261
90ce3da70b43 Initial load
duke
parents:
diff changeset
   262
        /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   263
     * Constructs a <code>SQLClientInfoException</code> object initialized with a
90ce3da70b43 Initial load
duke
parents:
diff changeset
   264
     * given  <code>reason</code>, <code>SQLState</code>,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   265
     * <code>cause</code>, <code>vendorCode</code> and
90ce3da70b43 Initial load
duke
parents:
diff changeset
   266
     * <code>failedProperties</code>.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   267
     *
23590
ffd8b0b70511 8038493: Tidy warnings cleanup for java.sql
yan
parents: 5506
diff changeset
   268
     * @param reason                    a description of the exception
ffd8b0b70511 8038493: Tidy warnings cleanup for java.sql
yan
parents: 5506
diff changeset
   269
     * @param SQLState                  an XOPEN or SQL:2003 code identifying the exception
ffd8b0b70511 8038493: Tidy warnings cleanup for java.sql
yan
parents: 5506
diff changeset
   270
     * @param vendorCode                a database vendor-specific exception code
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   271
     * @param failedProperties          A Map containing the property values that could not
90ce3da70b43 Initial load
duke
parents:
diff changeset
   272
     *                                  be set.  The keys in the Map
90ce3da70b43 Initial load
duke
parents:
diff changeset
   273
     *                                  contain the names of the client info
90ce3da70b43 Initial load
duke
parents:
diff changeset
   274
     *                                  properties that could not be set and
90ce3da70b43 Initial load
duke
parents:
diff changeset
   275
     *                                  the values contain one of the reason codes
90ce3da70b43 Initial load
duke
parents:
diff changeset
   276
     *                                  defined in <code>ClientInfoStatus</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   277
     * @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
23590
ffd8b0b70511 8038493: Tidy warnings cleanup for java.sql
yan
parents: 5506
diff changeset
   278
     *                                  the cause is non-existent or unknown.
ffd8b0b70511 8038493: Tidy warnings cleanup for java.sql
yan
parents: 5506
diff changeset
   279
     *
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   280
     * @since 1.6
90ce3da70b43 Initial load
duke
parents:
diff changeset
   281
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   282
        public SQLClientInfoException(String reason,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   283
                                                           String SQLState,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   284
                                                           int vendorCode,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   285
                                                           Map<String, ClientInfoStatus> failedProperties,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   286
                                                           Throwable cause) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   287
90ce3da70b43 Initial load
duke
parents:
diff changeset
   288
                super(reason, SQLState, vendorCode);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   289
                initCause(cause);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   290
                this.failedProperties = failedProperties;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   291
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   292
90ce3da70b43 Initial load
duke
parents:
diff changeset
   293
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   294
     * Returns the list of client info properties that could not be set.  The
90ce3da70b43 Initial load
duke
parents:
diff changeset
   295
     * keys in the Map  contain the names of the client info
90ce3da70b43 Initial load
duke
parents:
diff changeset
   296
     * properties that could not be set and the values contain one of the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   297
     * reason codes defined in <code>ClientInfoStatus</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   298
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   299
     * @return Map list containing the client info properties that could
90ce3da70b43 Initial load
duke
parents:
diff changeset
   300
     * not be set
23590
ffd8b0b70511 8038493: Tidy warnings cleanup for java.sql
yan
parents: 5506
diff changeset
   301
     *
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   302
     * @since 1.6
90ce3da70b43 Initial load
duke
parents:
diff changeset
   303
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   304
        public Map<String, ClientInfoStatus> getFailedProperties() {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   305
90ce3da70b43 Initial load
duke
parents:
diff changeset
   306
                return this.failedProperties;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   307
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   308
90ce3da70b43 Initial load
duke
parents:
diff changeset
   309
    private static final long serialVersionUID = -4319604256824655880L;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   310
}