1 /*
2 * Copyright (c) 2006, 2019, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation. Oracle designates this
8 * particular file as subject to the "Classpath" exception as provided
9 * by Oracle in the LICENSE file that accompanied this code.
10 *
11 * This code is distributed in the hope that it will be useful, but WITHOUT
12 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14 * version 2 for more details (a copy is included in the LICENSE file that
15 * accompanied this code).
16 *
17 * You should have received a copy of the GNU General Public License version
18 * 2 along with this work; if not, write to the Free Software Foundation,
19 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20 *
21 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
22 * or visit www.oracle.com if you need additional information or have any
30 * The subclass of {@link SQLException} is thrown when one or more client info properties
31 * could not be set on a <code>Connection</code>. In addition to the information provided
32 * by <code>SQLException</code>, a <code>SQLClientInfoException</code> provides a list of client info
33 * properties that were not set.
34 *
35 * Some databases do not allow multiple client info properties to be set
36 * atomically. For those databases, it is possible that some of the client
37 * info properties had been set even though the <code>Connection.setClientInfo</code>
38 * method threw an exception. An application can use the <code>getFailedProperties </code>
39 * method to retrieve a list of client info properties that were not set. The
40 * properties are identified by passing a
41 * <code>Map<String,ClientInfoStatus></code> to
42 * the appropriate <code>SQLClientInfoException</code> constructor.
43 *
44 * @see ClientInfoStatus
45 * @see Connection#setClientInfo
46 * @since 1.6
47 */
48 public class SQLClientInfoException extends SQLException {
49
50
51
52 @SuppressWarnings("serial") // Not statically typed as Serializable
53 private Map<String, ClientInfoStatus> failedProperties;
54
55 /**
56 * Constructs a <code>SQLClientInfoException</code> Object.
57 * The <code>reason</code>,
58 * <code>SQLState</code>, and failedProperties list are initialized to
59 * <code> null</code> and the vendor code is initialized to 0.
60 * The <code>cause</code> is not initialized, and may subsequently be
61 * initialized by a call to the
62 * {@link Throwable#initCause(java.lang.Throwable)} method.
63 *
64 * @since 1.6
65 */
66 public SQLClientInfoException() {
67
68 this.failedProperties = null;
69 }
70
71 /**
|
1 /*
2 * Copyright (c) 2006, 2020, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation. Oracle designates this
8 * particular file as subject to the "Classpath" exception as provided
9 * by Oracle in the LICENSE file that accompanied this code.
10 *
11 * This code is distributed in the hope that it will be useful, but WITHOUT
12 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14 * version 2 for more details (a copy is included in the LICENSE file that
15 * accompanied this code).
16 *
17 * You should have received a copy of the GNU General Public License version
18 * 2 along with this work; if not, write to the Free Software Foundation,
19 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20 *
21 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
22 * or visit www.oracle.com if you need additional information or have any
30 * The subclass of {@link SQLException} is thrown when one or more client info properties
31 * could not be set on a <code>Connection</code>. In addition to the information provided
32 * by <code>SQLException</code>, a <code>SQLClientInfoException</code> provides a list of client info
33 * properties that were not set.
34 *
35 * Some databases do not allow multiple client info properties to be set
36 * atomically. For those databases, it is possible that some of the client
37 * info properties had been set even though the <code>Connection.setClientInfo</code>
38 * method threw an exception. An application can use the <code>getFailedProperties </code>
39 * method to retrieve a list of client info properties that were not set. The
40 * properties are identified by passing a
41 * <code>Map<String,ClientInfoStatus></code> to
42 * the appropriate <code>SQLClientInfoException</code> constructor.
43 *
44 * @see ClientInfoStatus
45 * @see Connection#setClientInfo
46 * @since 1.6
47 */
48 public class SQLClientInfoException extends SQLException {
49
50 /**
51 * A {@code Map} containing the client info properties that could not be set.
52 */
53 @SuppressWarnings("serial") // Not statically typed as Serializable
54 private Map<String, ClientInfoStatus> failedProperties;
55
56 /**
57 * Constructs a <code>SQLClientInfoException</code> Object.
58 * The <code>reason</code>,
59 * <code>SQLState</code>, and failedProperties list are initialized to
60 * <code> null</code> and the vendor code is initialized to 0.
61 * The <code>cause</code> is not initialized, and may subsequently be
62 * initialized by a call to the
63 * {@link Throwable#initCause(java.lang.Throwable)} method.
64 *
65 * @since 1.6
66 */
67 public SQLClientInfoException() {
68
69 this.failedProperties = null;
70 }
71
72 /**
|