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. import java.sql.SQLException;
  7. /**
  8. * <P>The ConnectionEvent class provides information about the source of
  9. * a connection related event. ConnectionEvent objects provide the
  10. * following information:
  11. * <UL>
  12. * <LI>the pooled connection that generated the event
  13. * <LI>the SQLException about to be thrown to the application
  14. * ( in the case of an error event)
  15. * </UL>
  16. */
  17. public class ConnectionEvent extends java.util.EventObject {
  18. /**
  19. * <P>Construct a ConnectionEvent object. SQLException defaults to null.
  20. *
  21. * @param con the pooled connection that is the source of the event
  22. */
  23. public ConnectionEvent(PooledConnection con) {
  24. super(con);
  25. }
  26. /**
  27. * <P>Construct a ConnectionEvent object.
  28. *
  29. * @param con the pooled connection that is the source of the event
  30. * @param ex the SQLException about to be thrown to the application
  31. */
  32. public ConnectionEvent(PooledConnection con, SQLException ex) {
  33. super(con);
  34. this.ex = ex;
  35. }
  36. /**
  37. * <P>Get the SQLException. May be null.
  38. *
  39. * @return the SQLException about to be thrown
  40. */
  41. public SQLException getSQLException() { return ex; }
  42. private SQLException ex = null;
  43. }