org.apache.xalan.lib.sql
public class JNDIConnectionPool extends Object implements ConnectionPool
XConnection
when it
attempts to resolves a ConnectionPool
name as a JNDI data source.
Most methods in this implementation do nothing since configuration is handled
by the underlying JDBC datasource. Users should always call
XConnection.close()
from their stylsheet to explicitely close
their connection. However, since there is no way to enforce this
(Yikes!), it is recommended that a relatively short datasource timeout
be used to prevent dangling connections.
Constructor Summary | |
---|---|
JNDIConnectionPool()
Use of the default constructor requires the jndi path to be set via
setJndiPath(). | |
JNDIConnectionPool(String jndiDatasourcePath)
Creates a connection pool with a specified JNDI path. |
Method Summary | |
---|---|
void | freeUnused()
Intended to release unused connections from the pool.
|
Connection | getConnection()
Returns a connection from the JDNI DataSource found at the JNDI Datasource
path.
|
String | getJndiPath()
Returns the path for the jndi datasource |
boolean | hasActiveConnections()
Always returns false, indicating that this wrapper has no idea of what
connections the underlying JNDI source is maintaining. |
boolean | isEnabled()
Always returns true.
|
void | releaseConnection(Connection con) |
void | releaseConnectionOnError(Connection con) |
void | setDriver(String d)
Not implemented and will throw an Error if called.
|
void | setJndiPath(String jndiPath)
Sets the path for the jndi datasource |
void | setMinConnections(int n)
Ignored in this implementation b/c the pooling is determined by the jndi dataosource. |
void | setPassword(String p)
Sets the password for the connection.
|
void | setPoolEnabled(boolean flag)
Releases the reference to the jndi datasource.
|
void | setProtocol(Properties p)
Ignored in this implementation b/c the pooling is determined by the jndi dataosource. |
void | setURL(String url)
Not implemented and will throw an Error if called.
|
void | setUser(String u)
Sets the user name for the connection.
|
boolean | testConnection()
A simple test to see if the jndi datasource exists.
|
Parameters: jndiDatasourcePath Complete path to the JNDI datasource
Returns:
Throws: SQLException
Parameters: jndiPath
Returns:
Returns:
Parameters: d
Parameters: jndiPath
Parameters: n
Parameters: p the password
Parameters: flag If false, the reference to the datasource is released.
Parameters: p
Parameters: d
Parameters: u the user name