org.firebirdsql.pool

Class SimpleDataSource

Implemented Interfaces:
DataSource

public class SimpleDataSource
extends java.lang.Object
implements DataSource

This is simple implementation of DataSource interface that uses ConnectionPoolDataSource as connection provider.
Author:
Roman Rokytskyy

Constructor Summary

SimpleDataSource(ConnectionPoolDataSource pool)
Create instance of this class.

Method Summary

Connection
getConnection()
Get JDBC connection.
Connection
getConnection(String username, String password)
Get JDBC connection for the specified username and password.
PrintWriter
getLogWriter()
int
getLoginTimeout()
void
setLogWriter(PrintWriter out)
void
setLoginTimeout(int seconds)

Constructor Details

SimpleDataSource

public SimpleDataSource(ConnectionPoolDataSource pool)
Create instance of this class.
Parameters:
pool - instance of ConnectionPoolDataSource that will provide connections to this data source.

Method Details

getConnection

public Connection getConnection()
            throws SQLException
Get JDBC connection.
Returns:
instance of Connection from this data source.

getConnection

public Connection getConnection(String username,
                                String password)
            throws SQLException
Get JDBC connection for the specified username and password.
Parameters:
username - username for new connection.
password - password corresponding to the username.
Returns:
instance of Connection.

getLogWriter

public PrintWriter getLogWriter()
            throws SQLException

getLoginTimeout

public int getLoginTimeout()
            throws SQLException

setLogWriter

public void setLogWriter(PrintWriter out)
            throws SQLException

setLoginTimeout

public void setLoginTimeout(int seconds)
            throws SQLException

Copyright B) 2001 David Jencks and other authors. All rights reserved.