|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.apache.xalan.lib.sql.JNDIConnectionPool
A Connection Pool that wraps a JDBC datasource to provide connections.
An instance of this class is created by 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(java.lang.String jndiDatasourcePath)
Creates a connection pool with a specified JNDI path. |
Method Summary | |
void |
freeUnused()
Intended to release unused connections from the pool. |
java.sql.Connection |
getConnection()
Returns a connection from the JDNI DataSource found at the JNDI Datasource path. |
java.lang.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(java.sql.Connection con)
|
void |
releaseConnectionOnError(java.sql.Connection con)
|
void |
setDriver(java.lang.String d)
Not implemented and will throw an Error if called. |
void |
setJndiPath(java.lang.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(java.lang.String p)
Sets the password for the connection. |
void |
setPoolEnabled(boolean flag)
Releases the reference to the jndi datasource. |
void |
setProtocol(java.util.Properties p)
Ignored in this implementation b/c the pooling is determined by the jndi dataosource. |
void |
setURL(java.lang.String url)
Not implemented and will throw an Error if called. |
void |
setUser(java.lang.String u)
Sets the user name for the connection. |
boolean |
testConnection()
A simple test to see if the jndi datasource exists. |
Methods inherited from class java.lang.Object |
equals,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
Constructor Detail |
public JNDIConnectionPool()
public JNDIConnectionPool(java.lang.String jndiDatasourcePath)
jndiDatasourcePath
- Complete path to the JNDI datasourceMethod Detail |
public void setJndiPath(java.lang.String jndiPath)
jndiPath
- public java.lang.String getJndiPath()
jndiPath
- public boolean isEnabled()
public void setDriver(java.lang.String d)
d
- public void setURL(java.lang.String url)
d
- public void freeUnused()
public boolean hasActiveConnections()
public void setPassword(java.lang.String p)
p
- the passwordpublic void setUser(java.lang.String u)
u
- the user namepublic java.sql.Connection getConnection() throws java.sql.SQLException
public void releaseConnection(java.sql.Connection con) throws java.sql.SQLException
public void releaseConnectionOnError(java.sql.Connection con) throws java.sql.SQLException
public void setPoolEnabled(boolean flag)
flag
- If false, the reference to the datasource is released.public void setProtocol(java.util.Properties p)
p
- public void setMinConnections(int n)
n
- public boolean testConnection()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |