org.apache.xalan.lib.sql
Class DefaultConnectionPool
java.lang.Object
org.apache.xalan.lib.sql.DefaultConnectionPool
- ConnectionPool
public class DefaultConnectionPool
extends java.lang.Object
For internal connectiones, i.e. Connection information supplies in the
Stylesheet. The Default Connection Pool will be used.
void | freeUnused() - Go through the connection pool and release any connections
that are not InUse;
|
Connection | getConnection()
|
boolean | hasActiveConnections() - Is our ConnectionPool have any connections that are still in Use ?
|
void | initializePool()
|
boolean | isEnabled() - Return our current Active state
|
void | releaseConnection(Connection con)
|
void | releaseConnectionOnError(Connection con)
|
void | setDriver(String d) - Set the driver call to be used to create connections
|
void | setMinConnections(int n) - Override the current number of connections to keep in the pool.
|
void | setPassword(String p) - Set the password in the property set.
|
void | setPoolEnabled(boolean flag) - The Pool can be Enabled and Disabled.
|
void | setProtocol(Properties p) - The Protocol string is used to pass in other connection
properties.
|
void | setURL(String url) - Set the url used to connect to the database
|
void | setUser(String u) - Set the user name in the property set
|
boolean | testConnection() - Try to aquire a new connection, if it succeeds then return
true, else return false.
|
DefaultConnectionPool
public DefaultConnectionPool()
freeUnused
public void freeUnused()
Go through the connection pool and release any connections
that are not InUse;
- freeUnused in interface ConnectionPool
hasActiveConnections
public boolean hasActiveConnections()
Is our ConnectionPool have any connections that are still in Use ??
- hasActiveConnections in interface ConnectionPool
initializePool
public void initializePool()
throws IllegalArgumentException,
SQLException
setDriver
public void setDriver(String d)
Set the driver call to be used to create connections
- setDriver in interface ConnectionPool
setMinConnections
public void setMinConnections(int n)
Override the current number of connections to keep in the pool. This
setting will only have effect on a new pool or when a new connection
is requested and there is less connections that this setting.
- setMinConnections in interface ConnectionPool
setPoolEnabled
public void setPoolEnabled(boolean flag)
The Pool can be Enabled and Disabled. Disabling the pool
closes all the outstanding Unused connections and any new
connections will be closed upon release.
- setPoolEnabled in interface ConnectionPool
flag
- Control the Connection Pool.
If it is enabled then Connections will actuall be held
around. If disabled then all unused connections will be instantly
closed and as connections are released they are closed and removed
from the pool.
setProtocol
public void setProtocol(Properties p)
The Protocol string is used to pass in other connection
properties. A properties file is a general purpose container
- setProtocol in interface ConnectionPool
setURL
public void setURL(String url)
Set the url used to connect to the database
- setURL in interface ConnectionPool
setUser
public void setUser(String u)
Set the user name in the property set
- setUser in interface ConnectionPool
testConnection
public boolean testConnection()
Try to aquire a new connection, if it succeeds then return
true, else return false.
Note: This method will cause the connection pool to be built.
- testConnection in interface ConnectionPool
Copyright B) 2006 Apache XML Project. All Rights Reserved.