org.apache.cayenne.conn
Class PoolDataSource

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

public class PoolDataSource
extends java.lang.Object
implements javax.sql.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.

Author:
Andrei Adamchik

Constructor Summary
PoolDataSource(javax.sql.DataSource nonPooledDatasource)
          Creates new PoolDataSource
PoolDataSource(java.lang.String jdbcDriver, java.lang.String connectionUrl)
           
 
Method Summary
 int getLoginTimeout()
           
 java.io.PrintWriter getLogWriter()
           
 javax.sql.PooledConnection getPooledConnection()
           
 javax.sql.PooledConnection getPooledConnection(java.lang.String user, java.lang.String password)
           
 void setLoginTimeout(int seconds)
           
 void setLogWriter(java.io.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(javax.sql.DataSource nonPooledDatasource)
Creates new PoolDataSource


PoolDataSource

public PoolDataSource(java.lang.String jdbcDriver,
                      java.lang.String connectionUrl)
               throws java.sql.SQLException
Throws:
java.sql.SQLException
Method Detail

getLoginTimeout

public int getLoginTimeout()
                    throws java.sql.SQLException
Specified by:
getLoginTimeout in interface javax.sql.ConnectionPoolDataSource
Throws:
java.sql.SQLException

setLoginTimeout

public void setLoginTimeout(int seconds)
                     throws java.sql.SQLException
Specified by:
setLoginTimeout in interface javax.sql.ConnectionPoolDataSource
Throws:
java.sql.SQLException

getLogWriter

public java.io.PrintWriter getLogWriter()
                                 throws java.sql.SQLException
Specified by:
getLogWriter in interface javax.sql.ConnectionPoolDataSource
Throws:
java.sql.SQLException

setLogWriter

public void setLogWriter(java.io.PrintWriter out)
                  throws java.sql.SQLException
Specified by:
setLogWriter in interface javax.sql.ConnectionPoolDataSource
Throws:
java.sql.SQLException

getPooledConnection

public javax.sql.PooledConnection getPooledConnection()
                                               throws java.sql.SQLException
Specified by:
getPooledConnection in interface javax.sql.ConnectionPoolDataSource
Throws:
java.sql.SQLException

getPooledConnection

public javax.sql.PooledConnection getPooledConnection(java.lang.String user,
                                                      java.lang.String password)
                                               throws java.sql.SQLException
Specified by:
getPooledConnection in interface javax.sql.ConnectionPoolDataSource
Throws:
java.sql.SQLException


Copyright © 2001-2006 Apache.org All Rights Reserved.