Save This Page
Home » openjdk-7 » javax » sql » [javadoc | source]
    1   /*
    2    * Copyright 2000-2001 Sun Microsystems, Inc.  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.  Sun designates this
    8    * particular file as subject to the "Classpath" exception as provided
    9    * by Sun 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 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
   22    * CA 95054 USA or visit www.sun.com if you need additional information or
   23    * have any questions.
   24    */
   25   
   26   package javax.sql;
   27   
   28   /**
   29    * <P>
   30    * An object that registers to be notified of events generated by a
   31    * <code>PooledConnection</code> object.
   32    * <P>
   33    * The <code>ConnectionEventListener</code> interface is implemented by a
   34    * connection pooling component.  A connection pooling component will
   35    * usually be provided by a JDBC driver vendor or another system software
   36    * vendor.  A JDBC driver notifies a <code>ConnectionEventListener</code>
   37    * object when an application is finished using a pooled connection with
   38    * which the listener has registered.  The notification
   39    * occurs after the application calls the method <code>close</code> on
   40    * its representation of a <code>PooledConnection</code> object.  A
   41    * <code>ConnectionEventListener</code> is also notified when a
   42    * connection error occurs due to the fact that the <code>PooledConnection</code>
   43    * is unfit for future use---the server has crashed, for example.
   44    * The listener is notified by the JDBC driver just before the driver throws an
   45    * <code>SQLException</code> to the application using the
   46    * <code>PooledConnection</code> object.
   47    *
   48    * @since 1.4
   49    */
   50   
   51   public interface ConnectionEventListener extends java.util.EventListener {
   52   
   53     /**
   54      * Notifies this <code>ConnectionEventListener</code> that
   55      * the application has called the method <code>close</code> on its
   56      * representation of a pooled connection.
   57      *
   58      * @param event an event object describing the source of
   59      * the event
   60      */
   61     void connectionClosed(ConnectionEvent event);
   62   
   63     /**
   64      * Notifies this <code>ConnectionEventListener</code> that
   65      * a fatal error has occurred and the pooled connection can
   66      * no longer be used.  The driver makes this notification just
   67      * before it throws the application the <code>SQLException</code>
   68      * contained in the given <code>ConnectionEvent</code> object.
   69      *
   70      * @param event an event object describing the source of
   71      * the event and containing the <code>SQLException</code> that the
   72      * driver is about to throw
   73      */
   74     void connectionErrorOccurred(ConnectionEvent event);
   75   
   76    }

Save This Page
Home » openjdk-7 » javax » sql » [javadoc | source]