Since: API Level 1
public interface

ConnectionPoolDataSource

javax.sql.ConnectionPoolDataSource

Class Overview

An interface for the creation of ConnectionPoolDataSource objects. Used internally within the package.

A class which implements the ConnectionPoolDataSource interface is typically registered with a JNDI naming service directory and is retrieved from there by name.

Summary

Public Methods
abstract PrintWriter getLogWriter()
Gets the log writer for this ConnectionPoolDataSource.
abstract int getLoginTimeout()
Gets the login timeout value for this ConnectionPoolDataSource.
abstract PooledConnection getPooledConnection(String theUser, String thePassword)
Creates a connection to a database, using the supplied user name and password, which can then be used as a pooled connection.
abstract PooledConnection getPooledConnection()
Creates a connection to a database which can then be used as a pooled connection.
abstract void setLogWriter(PrintWriter theWriter)
Sets the log writer for this ConnectionPoolDataSource.
abstract void setLoginTimeout(int theTimeout)
Sets the login timeout value for this ConnectionPoolDataSource.

Public Methods

public abstract PrintWriter getLogWriter ()

Since: API Level 1

Gets the log writer for this ConnectionPoolDataSource.

The log writer is a stream to which all log and trace messages are sent from this ConnectionPoolDataSource. The log writer can be null, in which case the log and trace capture is disabled. The default value for the log writer when an ConnectionPoolDataSource is created is null. Note that the log writer for an ConnectionPoolDataSource is not the same as the log writer used by a DriverManager.

Returns
  • a PrintWriter which is the log writer for this ConnectionPoolDataSource. Can be null, in which case log writing is disabled for this ConnectionPoolDataSource.
Throws
SQLException if there is a problem accessing the database.

public abstract int getLoginTimeout ()

Since: API Level 1

Gets the login timeout value for this ConnectionPoolDataSource. The login timeout is the maximum time in seconds that the ConnectionPoolDataSource will wait when opening a connection to a database. A timeout value of 0 implies either the system default timeout value (if there is one) or that there is no timeout. The default value for the login timeout is 0.

Returns
  • the login timeout value in seconds.
Throws
SQLException if there is a problem accessing the database.

public abstract PooledConnection getPooledConnection (String theUser, String thePassword)

Since: API Level 1

Creates a connection to a database, using the supplied user name and password, which can then be used as a pooled connection.

Parameters
theUser the a user name for the database login.
thePassword the password associated with the user identified by theUser.
Returns
  • a PooledConnection object which represents the connection to the database.
Throws
SQLException if there is a problem accessing the database.

public abstract PooledConnection getPooledConnection ()

Since: API Level 1

Creates a connection to a database which can then be used as a pooled connection.

Returns
  • a PooledConnection which represents the connection to the database.
Throws
SQLException if there is a problem accessing the database.

public abstract void setLogWriter (PrintWriter theWriter)

Since: API Level 1

Sets the log writer for this ConnectionPoolDataSource.

The log writer is a stream to which all log and trace messages are sent from this ConnectionPoolDataSource. The log writer can be null, in which case log and trace capture is disabled. The default value for the log writer, when a ConnectionPoolDataSource is created, is null. Note that the log writer for a ConnectionPoolDataSource is not the same as the log writer used by a DriverManager.

Parameters
theWriter is the log writer for this ConnectionPoolDataSource.
Throws
SQLException if there is a problem accessing the database.

public abstract void setLoginTimeout (int theTimeout)

Since: API Level 1

Sets the login timeout value for this ConnectionPoolDataSource. The login timeout is the maximum time in seconds that the ConnectionPoolDataSource will wait when opening a connection to a database. A timeout value of 0 implies either the system default timeout value (if there is one) or that there is no timeout. The default value for the login timeout is 0.

Parameters
theTimeout the new login timeout value in seconds.
Throws
SQLException if there is a problem accessing the database.