org.apache.cayenne.conn
Class PoolDataSource

java.lang.Object
  extended by org.apache.cayenne.conn.PoolDataSource
All Implemented Interfaces:
CommonDataSource, ConnectionPoolDataSource

public class PoolDataSource
extends Object
implements ConnectionPoolDataSource

PoolDataSource allows to generate pooled connections.

It is implemented as a wrapper around a non-pooled data source object. Delegates all method calls except for "getPooledConnection" to the underlying datasource.


Constructor Summary
PoolDataSource(DataSource nonPooledDatasource)
          Creates new PoolDataSource
PoolDataSource(String jdbcDriver, String connectionUrl)
           
 
Method Summary
 int getLoginTimeout()
           
 PrintWriter getLogWriter()
           
 PooledConnection getPooledConnection()
           
 PooledConnection getPooledConnection(String user, String password)
           
 void setLoginTimeout(int seconds)
           
 void setLogWriter(PrintWriter out)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PoolDataSource

public PoolDataSource(DataSource nonPooledDatasource)
Creates new PoolDataSource


PoolDataSource

public PoolDataSource(String jdbcDriver,
                      String connectionUrl)
               throws SQLException
Throws:
SQLException
Method Detail

getLoginTimeout

public int getLoginTimeout()
                    throws SQLException
Specified by:
getLoginTimeout in interface CommonDataSource
Throws:
SQLException

setLoginTimeout

public void setLoginTimeout(int seconds)
                     throws SQLException
Specified by:
setLoginTimeout in interface CommonDataSource
Throws:
SQLException

getLogWriter

public PrintWriter getLogWriter()
                         throws SQLException
Specified by:
getLogWriter in interface CommonDataSource
Throws:
SQLException

setLogWriter

public void setLogWriter(PrintWriter out)
                  throws SQLException
Specified by:
setLogWriter in interface CommonDataSource
Throws:
SQLException

getPooledConnection

public PooledConnection getPooledConnection()
                                     throws SQLException
Specified by:
getPooledConnection in interface ConnectionPoolDataSource
Throws:
SQLException

getPooledConnection

public PooledConnection getPooledConnection(String user,
                                            String password)
                                     throws SQLException
Specified by:
getPooledConnection in interface ConnectionPoolDataSource
Throws:
SQLException


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