Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels) Summary: [Methods](https://developer.android.com/reference/javax/sql/ConnectionPoolDataSource#pubmethods) \| [Inherited Methods](https://developer.android.com/reference/javax/sql/ConnectionPoolDataSource#inhmethods)

# ConnectionPoolDataSource

` public interface ConnectionPoolDataSource `   
` implements https://developer.android.com/reference/javax/sql/CommonDataSource `

|---|
| javax.sql.ConnectionPoolDataSource |

<br />

*** ** * ** ***

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).

## Summary

| ### Public methods ||
|---|---|
| ` abstract https://developer.android.com/reference/javax/sql/PooledConnection` | ` https://developer.android.com/reference/javax/sql/ConnectionPoolDataSource#getPooledConnection()() ` Attempts to establish a physical database connection that can be used as a pooled connection. |
| ` abstract https://developer.android.com/reference/javax/sql/PooledConnection` | ` https://developer.android.com/reference/javax/sql/ConnectionPoolDataSource#getPooledConnection(java.lang.String,%20java.lang.String)(https://developer.android.com/reference/java/lang/String user, https://developer.android.com/reference/java/lang/String password) ` Attempts to establish a physical database connection that can be used as a pooled connection. |

### Inherited methods

From interface ` https://developer.android.com/reference/javax/sql/CommonDataSource ` ` abstract https://developer.android.com/reference/java/io/PrintWriter` ` https://developer.android.com/reference/javax/sql/CommonDataSource#getLogWriter()() `

<br />

Retrieves the log writer for this `DataSource` object.
` abstract int` ` https://developer.android.com/reference/javax/sql/CommonDataSource#getLoginTimeout()() `

Gets the maximum time in seconds that this data source can wait while attempting to connect to a database.
` abstract https://developer.android.com/reference/java/util/logging/Logger` ` https://developer.android.com/reference/javax/sql/CommonDataSource#getParentLogger()() `

Return the parent Logger of all the Loggers used by this data source.
` abstract void` ` https://developer.android.com/reference/javax/sql/CommonDataSource#setLogWriter(java.io.PrintWriter)(https://developer.android.com/reference/java/io/PrintWriter out) `

<br />

Sets the log writer for this `DataSource` object to the given `java.io.PrintWriter` object.
` abstract void` ` https://developer.android.com/reference/javax/sql/CommonDataSource#setLoginTimeout(int)(int seconds) `

<br />

Sets the maximum time in seconds that this data source will wait while attempting to connect to a database.

## Public methods

### getPooledConnection

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public abstract PooledConnection getPooledConnection ()
```

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

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/javax/sql/PooledConnection` | a `PooledConnection` object that is a physical connection to the database that this `ConnectionPoolDataSource` object represents <br /> |

| Throws ||
|---|---|
| `https://developer.android.com/reference/java/sql/SQLException` | if a database access error occurs |
| `https://developer.android.com/reference/java/sql/SQLFeatureNotSupportedException` | if the JDBC driver does not support this method |

### getPooledConnection

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public abstract PooledConnection getPooledConnection (String user, 
                String password)
```

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

<br />

| Parameters ||
|---|---|
| `user` | `String`: the database user on whose behalf the connection is being made <br /> |
| `password` | `String`: the user's password <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/javax/sql/PooledConnection` | a `PooledConnection` object that is a physical connection to the database that this `ConnectionPoolDataSource` object represents <br /> |

| Throws ||
|---|---|
| `https://developer.android.com/reference/java/sql/SQLException` | if a database access error occurs |
| `https://developer.android.com/reference/java/sql/SQLFeatureNotSupportedException` | if the JDBC driver does not support this method |