Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.apache.cayenne.conn
Class PooledConnectionImpl

    java.lang.Object
      org.apache.cayenne.conn.PooledConnectionImpl

All Implemented Interfaces:
  PooledConnection

    public class PooledConnectionImpl

extends Object
implements PooledConnection

PooledConnectionImpl is an implementation of a pooling wrapper for the database connection as per JDBC3 spec. Most of the modern JDBC drivers should have its own implementation that may be used instead of this class.

Author:
  Andrus Adamchik

Constructor Summary
`protected` | `PooledConnectionImpl()`
`` | `PooledConnectionImpl(DataSource connectionSource, String userName, String password)` Creates new PooledConnection

Method Summary
`void` | `addConnectionEventListener(ConnectionEventListener listener)`
`void` | `close()`
`protected void` | `connectionClosedNotification()` Creates and sends an event to listeners when a user closes java.sql.Connection object belonging to this PooledConnection.
`void` | `connectionErrorNotification(SQLException exception)` This method creates and sents an event to listeners when an error occurs in the underlying connection.
`Connection` | `getConnection()`
`void` | `reconnect()`
`void` | `removeConnectionEventListener(ConnectionEventListener listener)`
`protected void` | `returnConnectionToThePool()`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### PooledConnectionImpl

    protected PooledConnectionImpl()

### PooledConnectionImpl

    public PooledConnectionImpl(DataSource connectionSource,
                                String userName,
                                String password)

  Creates new PooledConnection

Method Detail

### reconnect

    public void reconnect()
                   throws SQLException

  Throws:
    `SQLException`

### addConnectionEventListener

    public void addConnectionEventListener(ConnectionEventListener listener)

  Specified by:
    `addConnectionEventListener` in interface `PooledConnection`

### removeConnectionEventListener

    public void removeConnectionEventListener(ConnectionEventListener listener)

  Specified by:
    `removeConnectionEventListener` in interface `PooledConnection`

### close

    public void close()
               throws SQLException

  Specified by:
    `close` in interface `PooledConnection`
  Throws:
    `SQLException`

### getConnection

    public Connection getConnection()
                             throws SQLException

  Specified by:
    `getConnection` in interface `PooledConnection`
  Throws:
    `SQLException`

### returnConnectionToThePool

    protected void returnConnectionToThePool()
                                      throws SQLException

  Throws:
    `SQLException`

### connectionErrorNotification

    public void connectionErrorNotification(SQLException exception)

  This method creates and sents an event to listeners when an error occurs in the underlying connection. Listeners can have special logic to analyze the error and do things like closing this PooledConnection (if the error is fatal), etc...

### connectionClosedNotification

    protected void connectionClosedNotification()

  Creates and sends an event to listeners when a user closes java.sql.Connection object belonging to this PooledConnection.

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2001-2008 Apache Cayenne. All Rights Reserved.