1. /*
  2. * Copyright 2002 Sun Microsystems, Inc. All rights reserved.
  3. * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
  4. */
  5. package javax.sql;
  6. /**
  7. <P>
  8. A ConnectionEventListener is an object that registers to receive
  9. events generated by a PooledConnection.
  10. <P>
  11. The ConnectionEventListener interface is implemented by a
  12. connection pooling component. A connection pooling component will
  13. usually be provided by a JDBC driver vendor, or another system software
  14. vendor. A ConnectionEventListener is notified by a JDBC driver when
  15. an application is finished using its Connection object. This event occurs
  16. after the application calls close on its representation of the
  17. PooledConnection. A ConnectionEventListener is also notified when a
  18. Connection error occurs due to the fact that the PooledConnection is unfit
  19. for future use---the server has crashed, for example. The listener is
  20. notified, by the JDBC driver, just before the driver throws an
  21. SQLException to the application using the PooledConnection.
  22. */
  23. public interface ConnectionEventListener extends java.util.EventListener {
  24. /**
  25. * <P>Invoked when the application calls close() on its
  26. * representation of the connection.
  27. *
  28. * @param event an event object describing the source of
  29. * the event
  30. */
  31. void connectionClosed(ConnectionEvent event);
  32. /**
  33. * <p>Invoked when a fatal connection error occurs, just before
  34. * an SQLException is thrown to the application.
  35. *
  36. * @param event an event object describing the source of
  37. * the event
  38. */
  39. void connectionErrorOccurred(ConnectionEvent event);
  40. }