|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.ca.jcs.jdbc.JDBCConnectionManager
public class JDBCConnectionManager
Simplistic connection manager wrapping a datasource and returning Connections.
Not expected to to be used universally as clients making use of higher level APIs like
Spring may well choose to use the non-standard connector.getDataSource() instead
of dealing with SQL connections explicitly.
Note that any SQL exceptions thrown are wrapped and converted to Spring exceptions so they
can be mapped to NamingExceptions in a consistent way by JDBCExceptionMappingProxy.
| Constructor Summary | |
|---|---|
JDBCConnectionManager(DataSource dataSource)
|
|
| Method Summary | |
|---|---|
void |
activate()
Derived classes should override if required, is a stub in this class. |
Object |
borrowConnection()
Needs to be abstract for force implementers to very carefully review any exceptions that might be thrown and decide which ones are retriable soft failures (in which case should throw LdapServiceUnavailableException
with code ResultCodeEnum.UNAVAILABLE)
and which ones are hard failures (in which can throw LdapServiceUnavailableException
with any other code, or any other NamingException variety which implements
LdapException). |
void |
clearConnection()
This method can be called to clear all existing connections in the pool when one is found to be in a in stale or inconsistent state. |
void |
deactivate()
Derived classes should override if required, is a stub in this class. |
void |
returnConnection(Object connection)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public JDBCConnectionManager(DataSource dataSource)
| Method Detail |
|---|
public Object borrowConnection()
throws NamingException
ConnectionManagerLdapServiceUnavailableException
with code ResultCodeEnum.UNAVAILABLE)
and which ones are hard failures (in which can throw LdapServiceUnavailableException
with any other code, or any other NamingException variety which implements
LdapException).
borrowConnection in interface ConnectionManagerNamingException - If connection can't be borrowed, can't return null.public void returnConnection(Object connection)
returnConnection in interface ConnectionManager
public void activate()
throws NamingException
activate in interface ActivatableNamingException
public void deactivate()
throws NamingException
deactivate in interface ActivatableNamingException
public void clearConnection()
throws NamingException
ConnectionManager
clearConnection in interface ConnectionManagerNamingException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||