org.apache.cayenne.conn

## Class PoolDataSource

- java.lang.Object
- - 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

    Constructors
    Constructor and Description
    `PoolDataSource(DataSource nonPooledDatasource)` Creates new PoolDataSource
    `PoolDataSource(String jdbcDriver, String connectionUrl)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `int` | `getLoginTimeout()`
    `PrintWriter` | `getLogWriter()`
    `Logger` | `getParentLogger()`
    `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`

    - #### getParentLogger

          public Logger getParentLogger()
                                 throws SQLFeatureNotSupportedException

      Specified by:
        `getParentLogger` in interface `CommonDataSource`
      Throws:
        `SQLFeatureNotSupportedException`
      Since:
        3.1 JDBC 4.1 compatibility under Java 1.5

Copyright © 2001–2018 Apache Cayenne. All rights reserved.