DataSourceWrapperpublic class DataSourceWrapper extends Object implements DataSourceThis 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. |
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.Connection | getConnection()Gets a connection from the pool and returns it wrapped in
a ConnectionWrapper.
return new ConnectionWrapper(pool.getConnection(), this);
| public java.sql.Connection | getConnection(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.PrintWriter | getLogWriter()Always throws a SQLException. Not supported.
throw new SQLException("Not supported");
| public int | getLoginTimeout()Always throws a SQLException. Not supported.
throw new SQLException("Not supported");
| public void | returnConnection(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 void | setLogWriter(java.io.PrintWriter out)Always throws a SQLException. Not supported.
throw new SQLException("Not supported");
| public void | setLoginTimeout(int seconds)Always throws a SQLException. Not supported.
throw new SQLException("Not supported");
|
|