Build 1.0_r1(from source)

javax.sql
Interface ConnectionPoolDataSource


public interface ConnectionPoolDataSource

An interface for the creation of PooledConnection 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.


Method Summary
 int getLoginTimeout()
          Gets the Login Timeout value for this ConnectionPoolDataSource.
 PrintWriter getLogWriter()
          Gets the Log Writer for this ConnectionPoolDataSource.
 PooledConnection getPooledConnection()
          Create a connection to a database which can then be used as a pooled connection.
 PooledConnection getPooledConnection(String theUser, String thePassword)
          Create a connection to a database, using a supplied Username and Password, which can then be used as a pooled connection.
 void setLoginTimeout(int theTimeout)
          Sets the Login Timeout value for this ConnectionPoolDataSource.
 void setLogWriter(PrintWriter theWriter)
          Sets the Log Writer for this ConnectionPoolDataSource.
 

Method Detail

getLoginTimeout

int getLoginTimeout()
                    throws SQLException
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.

getLogWriter

PrintWriter getLogWriter()
                         throws SQLException
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, 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.

getPooledConnection

PooledConnection getPooledConnection()
                                     throws SQLException
Create 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.

getPooledConnection

PooledConnection getPooledConnection(String theUser,
                                     String thePassword)
                                     throws SQLException
Create a connection to a database, using a supplied Username and Password, which can then be used as a pooled connection.

Parameters:
theUser - a String containing a User Name for the database
thePassword - a String containing the Password for the user identified by theUser
Returns:
a PooledConnection which represents the connection to the database
Throws:
SQLException - if there is a problem accessing the database.

setLoginTimeout

void setLoginTimeout(int theTimeout)
                     throws SQLException
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.

setLogWriter

void setLogWriter(PrintWriter theWriter)
                  throws SQLException
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 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.

Parameters:
theWriter - a PrintWriter to use as the Log Writer for this ConnectionPoolDataSource.
Throws:
SQLException - if there is a problem accessing the database.

Build 1.0_r1(from source)

Please submit a feedback, bug or feature