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.Connection;
  7. import java.sql.SQLException;
  8. /**
  9. * <p>A PooledConnection object is a connection object that provides
  10. * hooks for connection pool management. A PooledConnection object
  11. * represents a physical connection to a data source.
  12. */
  13. public interface PooledConnection {
  14. /**
  15. * <p>Create an object handle for this physical connection. The object
  16. * returned is a temporary handle used by application code to refer to
  17. * a physical connection that is being pooled.
  18. *
  19. * @return a Connection object
  20. * @exception SQLException if a database-access error occurs.
  21. */
  22. Connection getConnection() throws SQLException;
  23. /**
  24. * <p>Close the physical connection.
  25. *
  26. * @exception SQLException if a database-access error occurs.
  27. */
  28. void close() throws SQLException;
  29. /**
  30. * <P> Add an event listener.
  31. */
  32. void addConnectionEventListener(ConnectionEventListener listener);
  33. /**
  34. * <P> Remove an event listener.
  35. */
  36. void removeConnectionEventListener(ConnectionEventListener listener);
  37. }