# ConnectionPoolDataSource

public interface **ConnectionPoolDataSource** implements [CommonDataSource](https://developers.google.com/j2objc/javadoc/jre/reference/javax/sql/CommonDataSource.html) A factory for `PooledConnection`
objects. An object that implements this interface will typically be
registered with a naming service that is based on the
Java^TM^ Naming and Directory Interface
(JNDI).

### Public Method Summary

|---|---|
| abstract [PooledConnection](https://developers.google.com/j2objc/javadoc/jre/reference/javax/sql/PooledConnection.html) | [getPooledConnection](https://developers.google.com/j2objc/javadoc/jre/reference/javax/sql/ConnectionPoolDataSource.html#getPooledConnection())() Attempts to establish a physical database connection that can be used as a pooled connection. |
| abstract [PooledConnection](https://developers.google.com/j2objc/javadoc/jre/reference/javax/sql/PooledConnection.html) | [getPooledConnection](https://developers.google.com/j2objc/javadoc/jre/reference/javax/sql/ConnectionPoolDataSource.html#getPooledConnection(java.lang.String,%20java.lang.String))([String](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/String.html) user, [String](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/String.html) password) Attempts to establish a physical database connection that can be used as a pooled connection. |

### Inherited Method Summary

From interface [javax.sql.CommonDataSource](https://developers.google.com/j2objc/javadoc/jre/reference/javax/sql/CommonDataSource.html)

|---|---|
| abstract [PrintWriter](https://developers.google.com/j2objc/javadoc/jre/reference/java/io/PrintWriter.html) | [getLogWriter](https://developers.google.com/j2objc/javadoc/jre/reference/javax/sql/CommonDataSource.html#getLogWriter())() Retrieves the log writer for this `DataSource` object. |
| abstract int | [getLoginTimeout](https://developers.google.com/j2objc/javadoc/jre/reference/javax/sql/CommonDataSource.html#getLoginTimeout())() Gets the maximum time in seconds that this data source can wait while attempting to connect to a database. |
| abstract [Logger](https://developers.google.com/j2objc/javadoc/jre/reference/java/util/logging/Logger.html) | [getParentLogger](https://developers.google.com/j2objc/javadoc/jre/reference/javax/sql/CommonDataSource.html#getParentLogger())() Return the parent Logger of all the Loggers used by this data source. |
| abstract void | [setLogWriter](https://developers.google.com/j2objc/javadoc/jre/reference/javax/sql/CommonDataSource.html#setLogWriter(java.io.PrintWriter))([PrintWriter](https://developers.google.com/j2objc/javadoc/jre/reference/java/io/PrintWriter.html) out) Sets the log writer for this `DataSource` object to the given `java.io.PrintWriter` object. |
| abstract void | [setLoginTimeout](https://developers.google.com/j2objc/javadoc/jre/reference/javax/sql/CommonDataSource.html#setLoginTimeout(int))(int seconds) Sets the maximum time in seconds that this data source will wait while attempting to connect to a database. |

## Public Methods

#### public abstract [PooledConnection](https://developers.google.com/j2objc/javadoc/jre/reference/javax/sql/PooledConnection.html)
**getPooledConnection**
()

Attempts to establish a physical database connection that can
be used as a pooled connection.

##### Returns

- a `PooledConnection` object that is a physical connection to the database that this `ConnectionPoolDataSource` object represents

##### Throws

| [SQLException](https://developers.google.com/j2objc/javadoc/jre/reference/java/sql/SQLException.html) | if a database access error occurs |
|   | if the JDBC driver does not support this method |
|---|---|

#### public abstract [PooledConnection](https://developers.google.com/j2objc/javadoc/jre/reference/javax/sql/PooledConnection.html)
**getPooledConnection**
([String](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/String.html) user, [String](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/String.html) password)

Attempts to establish a physical database connection that can
be used as a pooled connection.

##### Parameters

| user | the database user on whose behalf the connection is being made |
| password | the user's password |
|---|---|

##### Returns

- a `PooledConnection` object that is a physical connection to the database that this `ConnectionPoolDataSource` object represents

##### Throws

| [SQLException](https://developers.google.com/j2objc/javadoc/jre/reference/java/sql/SQLException.html) | if a database access error occurs |
|   | if the JDBC driver does not support this method |
|---|---|