0N/A/*
2362N/A * Copyright (c) 2000, 2006, Oracle and/or its affiliates. All rights reserved.
0N/A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
0N/A *
0N/A * This code is free software; you can redistribute it and/or modify it
0N/A * under the terms of the GNU General Public License version 2 only, as
2362N/A * published by the Free Software Foundation. Oracle designates this
0N/A * particular file as subject to the "Classpath" exception as provided
2362N/A * by Oracle in the LICENSE file that accompanied this code.
0N/A *
0N/A * This code is distributed in the hope that it will be useful, but WITHOUT
0N/A * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
0N/A * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
0N/A * version 2 for more details (a copy is included in the LICENSE file that
0N/A * accompanied this code).
0N/A *
0N/A * You should have received a copy of the GNU General Public License version
0N/A * 2 along with this work; if not, write to the Free Software Foundation,
0N/A * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
0N/A *
2362N/A * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
2362N/A * or visit www.oracle.com if you need additional information or have any
2362N/A * questions.
0N/A */
0N/A
0N/Apackage javax.sql;
0N/A
0N/Aimport java.sql.SQLException;
0N/A
0N/A/**
0N/A * <P>An <code>Event</code> object that provides information about the
0N/A * source of a connection-related event. <code>ConnectionEvent</code>
0N/A * objects are generated when an application closes a pooled connection
0N/A * and when an error occurs. The <code>ConnectionEvent</code> object
0N/A * contains two kinds of information:
0N/A * <UL>
0N/A * <LI>The pooled connection closed by the application
0N/A * <LI>In the case of an error event, the <code>SQLException</code>
0N/A * about to be thrown to the application
0N/A * </UL>
0N/A *
0N/A * @since 1.4
0N/A */
0N/A
0N/Apublic class ConnectionEvent extends java.util.EventObject {
0N/A
0N/A /**
0N/A * <P>Constructs a <code>ConnectionEvent</code> object initialized with
0N/A * the given <code>PooledConnection</code> object. <code>SQLException</code>
0N/A * defaults to <code>null</code>.
0N/A *
0N/A * @param con the pooled connection that is the source of the event
0N/A * @throws IllegalArgumentException if <code>con</code> is null.
0N/A */
0N/A public ConnectionEvent(PooledConnection con) {
0N/A super(con);
0N/A }
0N/A
0N/A /**
0N/A * <P>Constructs a <code>ConnectionEvent</code> object initialized with
0N/A * the given <code>PooledConnection</code> object and
0N/A * <code>SQLException</code> object.
0N/A *
0N/A * @param con the pooled connection that is the source of the event
0N/A * @param ex the SQLException about to be thrown to the application
0N/A * @throws IllegalArgumentException if <code>con</code> is null.
0N/A */
0N/A public ConnectionEvent(PooledConnection con, SQLException ex) {
0N/A super(con);
0N/A this.ex = ex;
0N/A }
0N/A
0N/A /**
0N/A * <P>Retrieves the <code>SQLException</code> for this
0N/A * <code>ConnectionEvent</code> object. May be <code>null</code>.
0N/A *
0N/A * @return the SQLException about to be thrown or <code>null</code>
0N/A */
0N/A public SQLException getSQLException() { return ex; }
0N/A
0N/A /**
0N/A * The <code>SQLException</code> that the driver will throw to the
0N/A * application when an error occurs and the pooled connection is no
0N/A * longer usable.
0N/A * @serial
0N/A */
0N/A private SQLException ex = null;
0N/A
0N/A /**
0N/A * Private serial version unique ID to ensure serialization
0N/A * compatibility.
0N/A */
0N/A static final long serialVersionUID = -4843217645290030002L;
0N/A
0N/A }