FileDocCategorySizeDatePackage
DataSourceWrapper.javaAPI DocExample2319Thu Jun 28 16:14:16 BST 2001com.ora.jsp.sql

DataSourceWrapper

public class DataSourceWrapper extends Object implements DataSource
This class is a wrapper implementing the JDBC 2.0 SE DataSource interface, used to make the ConnectionPool class look like a JDBC 2.0 DataSource.
author
Hans Bergsten, Gefion software
version
1.0

Fields Summary
private ConnectionPool
pool
Constructors Summary
public DataSourceWrapper(String driverClass, String url, String user, String pw)

        pool = new ConnectionPool(url, user, pw, driverClass, 1, 1);
    
Methods Summary
public java.sql.ConnectiongetConnection()
Gets a connection from the pool and returns it wrapped in a ConnectionWrapper.

        return new ConnectionWrapper(pool.getConnection(), this);
    
public java.sql.ConnectiongetConnection(java.lang.String username, java.lang.String password)
Always throws a SQLException. Username and password are set in the constructor and can not be changed.

        throw new SQLException("Not supported");
    
public java.io.PrintWritergetLogWriter()
Always throws a SQLException. Not supported.

        throw new SQLException("Not supported");
    
public intgetLoginTimeout()
Always throws a SQLException. Not supported.

        throw new SQLException("Not supported");
    
public voidreturnConnection(java.sql.Connection conn)
Returns a Connection to the pool. This method is called by the ConnectionWrapper's close() method.

        pool.returnConnection(conn);
    
public synchronized voidsetLogWriter(java.io.PrintWriter out)
Always throws a SQLException. Not supported.

        throw new SQLException("Not supported");
    
public voidsetLoginTimeout(int seconds)
Always throws a SQLException. Not supported.

        throw new SQLException("Not supported");