Methods Summary |
---|
private void | createConnectionPool()Create a Connection pool based on the configuration properties.
try {
pool = new ConnectionPool(driverClassName, url, user,
password, initialConnections);
}
catch (SQLException e) {
throw e;
}
catch (Exception e) {
SQLException sqle =
new SQLException("Error creating pool: " +
e.getClass().getName() + " : " + e.getMessage());
throw sqle;
}
|
public java.sql.Connection | getConnection()Gets a connection from the pool and returns it wrapped in
a ConnectionWrapper.
if (pool == null) {
createConnectionPool();
}
return new ConnectionWrapper(pool.getConnection(), this);
|
public java.sql.Connection | getConnection(java.lang.String username, java.lang.String password)Always throws an SQLException. Username and password are set
with the setter methods and can not be changed.
throw new SQLException("Not supported");
|
public java.io.PrintWriter | getLogWriter()Always throws an SQLException. Not supported.
throw new SQLException("Not supported");
|
public int | getLoginTimeout()Always throws an 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 void | setDriverClassName(java.lang.String driverClassName)Sets the JDBC driver class name for the pool.
this.driverClassName = driverClassName;
|
public void | setInitialConnections(int initialConnections)Sets the number of connections to create when the pool is
created.
this.initialConnections = initialConnections;
|
public synchronized void | setLogWriter(java.io.PrintWriter out)Always throws an SQLException. Not supported.
throw new SQLException("Not supported");
|
public void | setLoginTimeout(int seconds)Always throws an SQLException. Not supported.
throw new SQLException("Not supported");
|
public void | setPassword(java.lang.String password)Sets the user account password for the pool.
this.password = password;
|
public void | setUrl(java.lang.String url)Sets the JDBC URL for the pool.
this.url = url;
|
public void | setUser(java.lang.String user)Sets the user account for the pool.
this.user = user;
|