|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.apache.avalon.framework.logger.AbstractLogEnabled | +--org.apache.avalon.excalibur.datasource.AbstractJdbcConnection
The Connection object used in conjunction with the JdbcDataSource object.
Field Summary | |
protected Connection |
m_connection
|
protected long |
m_lastUsed
|
protected Pool |
m_pool
|
protected SQLException |
m_testException
|
protected PreparedStatement |
m_testStatement
|
Constructor Summary | |
AbstractJdbcConnection(Connection connection,
boolean oradb)
Deprecated. Use the version with keepAlive specified |
|
AbstractJdbcConnection(Connection connection,
String keepAlive)
|
Method Summary | |
protected void |
clearAllocatedStatements()
Closes statements that were registered and removes all statements from the list of allocated ones. |
void |
close()
|
void |
dispose()
|
void |
enableLogging(Logger log)
|
boolean |
equals(Object obj)
|
Connection |
getConnection()
|
void |
initialize()
|
Object |
invoke(Object proxy,
Method method,
Object[] args)
|
boolean |
isClosed()
|
void |
recycle()
|
protected void |
registerAllocatedStatement(Statement stmt)
Adds the statement to the list of this connection. |
void |
setPool(Pool pool)
Set the pool that will be used to recycle. |
void |
setProxiedConnection(Object proxy)
|
Methods inherited from class org.apache.avalon.framework.logger.AbstractLogEnabled |
getLogger, setupLogger, setupLogger, setupLogger |
Methods inherited from class java.lang.Object |
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected Connection m_connection
protected Pool m_pool
protected PreparedStatement m_testStatement
protected SQLException m_testException
protected long m_lastUsed
Constructor Detail |
public AbstractJdbcConnection(Connection connection, boolean oradb)
public AbstractJdbcConnection(Connection connection, String keepAlive)
connection
- a driver specific JDBC connection to be wrapped.keepAlive
- a query which will be used to check the statis of the connection after it
has been idle. A null value will cause the keep alive feature to
be disabled.Method Detail |
public void initialize()
public void enableLogging(Logger log)
enableLogging
in interface LogEnabled
enableLogging
in class AbstractLogEnabled
public void setPool(Pool pool)
PoolSettable
setPool
in interface PoolSettable
pool
- public void recycle()
recycle
in interface Recyclable
public void setProxiedConnection(Object proxy)
setProxiedConnection
in interface ProxiedJdbcConnection
public Connection getConnection()
getConnection
in interface ProxiedJdbcConnection
public boolean isClosed() throws SQLException
isClosed
in interface PoolSettable
SQLException
public void close() throws SQLException
SQLException
protected void clearAllocatedStatements() throws SQLException
Holds m_allocatedStatements locked the whole time. This should not be a problem because connections are inherently single threaded objects and any attempt to use them from a different thread while it is being closed is a violation of the contract.
SQLException
- of the first Statement.close()protected void registerAllocatedStatement(Statement stmt)
public void dispose()
dispose
in interface Disposable
public boolean equals(Object obj)
equals
in class Object
public Object invoke(Object proxy, Method method, Object[] args) throws Throwable
invoke
in interface InvocationHandler
Throwable
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |