O'Reilly logo

Database Programming with JDBC & Java, Second Edition by George Reese

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Name

PooledConnection

Synopsis

Interface Name: javax.sql.PooledConnection

Superclass: None

Immediate Subclasses: javax.sql.XAConnection

Interfaces Implemented: None

Availability: New as of JDK 1.2

Description

A PooledConnection represents a physical connection to a data source. An application uses a PooledConnection to grab a specific JDBC connection object from the connection pool for use in talking to a database.

Class Summary

public interface PooledConnection {
    void addConnectionEventListener(ConnectionEventListener l)
      throws java.sql.SQLException;
    void close( ) throws java.sql.SQLException;
    java.sql.Connection getConnection( ) 
      throws java.sql.SQLException;
    void removeConnectionEventListener(ConnectionEventListener l)
      throws java.sql.SQLException;
}

Object Methods

addConnectionEventListener( ) and removeConnectionEventListener( )

public void addConnectionEventListener(ConnectionEventListener l)
  throws java.sql.SQLException;
public void removeConnectionEventListener(ConnectionEventListener l)
  throws java.sql.SQLException;
Description

These two methods manage the addition and removal of objects listening for connection events generated by this pooled connection.

close( )

public void close( ) throws java.sql.SQLException;
Description

This method will close all resources for the underlying connection to the database held by this pooled connection.

getConnection( )

public java.sql.Connection getConnection( ) 
  throws java.sql.SQLException;
Description

The getConnection() method provides temporary access ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required