#include <Connection.h>
Inheritance diagram for Connection

Public Methods | |
| virtual | ~Connection () |
| virtual void | setAutoCommit (bool autoCommit) = 0 |
| virtual void | commit () = 0 |
| virtual void | close () |
| Doesn't actually close the connection, but instead returns itself back to the pool to be re-used. More... | |
| virtual void | rollback () = 0 |
| virtual Statement* | createStatement () = 0 |
| PreparedStatement* | prepareStatement (const nsAReadableString& sql) |
| CallableStatement* | prepareCall (const nsAReadableString& sql) |
| virtual const nsAReadableString& | nativeSQL (const nsAReadableString& sql) |
| virtual bool | getAutoCommit () |
| virtual bool | isClosed () |
| virtual DatabaseMetaData* | getMetaData () |
| virtual void | setReadOnly (bool readOnly) |
| virtual bool | isReadOnly () |
| virtual void | setCatalog (const nsAReadableString& catalog) |
| virtual const nsAReadableString& | getCatalog () |
| virtual void | setTransactionIsolation (int level) |
| virtual int | getTransactionIsolation () |
| virtual SQLWarning* | getWarnings () |
| virtual void | clearWarnings () |
Protected Methods | |
| Connection () | |
| virtual ConnectionPool* | getPool () = 0 |
| virtual PreparedStatement* | newPreparedStatement (const nsAReadableString& sql) = 0 |
| virtual CallableStatement* | newCallableStatement (const nsAReadableString& sql) = 0 |
| void | run () |
| This is used by ConnectionPool.removeConnection(). More... | |
| void | closeStatements () |
| Closes all PreparedStatments and CallableStatements. More... | |
| bool | getLock () |
| Returns true if this Connection is not in use. More... | |
| bool | isLocked () |
| int | getCheckoutCount () |
| Returns number of times this node has been checked out from the pool. More... | |
| long | getLastAccess () |
| Returns when this connection was last checked out; 0 if it has never been used. More... | |
| void | releaseLock () |
| called by ConnectionPool.returnConnection() right before it wakes up the threads. More... | |
| void | destroy () |
Private Types | |
| typedef std::map<const nsAReadableString*, PreparedStatement*, compareARS> | mapStringPreparedStatement |
| typedef std::map<const nsAReadableString*, CallableStatement*, compareARS> | mapStringCallableStatement |
Private Attributes | |
| friend | ConnectionPool |
| bool | m_locked |
| long | m_lastAccess |
| bool | m_free |
| int | m_checkoutCount |
| mapStringPreparedStatement | m_prepStmts |
| mapStringCallableStatement | m_callStmts |
|
|
Definition at line 33 of file Connection.h. |
|
|
Definition at line 30 of file Connection.h. |
|
|
Definition at line 22 of file Connection.cpp. |
|
|
Definition at line 43 of file Connection.cpp. |
|
|
Definition at line 71 of file Connection.h. |
|
|
Doesn't actually close the connection, but instead returns itself back to the pool to be re-used. However, if you specified maxCheckouts in the constructor, then this *will* close the JDBC Connection and re-open it if the number of checkouts has been exceeded. Reimplemented in ConnectionDB2, ConnectionODBC, ConnectionOracle, and ConnectionSybase. Definition at line 131 of file Connection.cpp. Referenced by ConnectionPoolODBC::buildPool(), ConnectionSybase::close(), ConnectionOracle::close(), ConnectionODBC::close(), ConnectionDB2::close(), closeStatements(), DBPage::releaseConnection(), DBPage::rollbackConnection(), and run(). |
|
|
Closes all PreparedStatments and CallableStatements.
Definition at line 71 of file Connection.cpp. Referenced by run(). |
|
|
Reimplemented in ConnectionDB2, ConnectionODBC, ConnectionOracle, and ConnectionSybase. Referenced by DBPage::releaseConnection(). |
|
|
Reimplemented in ConnectionDB2, ConnectionODBC, ConnectionOracle, and ConnectionSybase. Referenced by Transaction::aSeek(), and ConnectionPoolODBC::buildPool(). |
|
|
Definition at line 30 of file Connection.cpp. Referenced by ~Connection(), and ConnectionODBC::~ConnectionODBC(). |
|
|
Definition at line 61 of file Connection.h. |
|
|
Definition at line 179 of file Connection.cpp. |
|
|
Returns number of times this node has been checked out from the pool.
Definition at line 111 of file Connection.cpp. Referenced by ConnectionPool::returnConnection(). |
|
|
Returns when this connection was last checked out; 0 if it has never been used.
Definition at line 120 of file Connection.cpp. |
|
|
Returns true if this Connection is not in use. Returns false if it is in use Definition at line 87 of file Connection.cpp. Referenced by ConnectionPool::getConnection(). |
|
|
Definition at line 63 of file Connection.h. |
|
|
Reimplemented in ConnectionDB2, ConnectionODBC, ConnectionOracle, and ConnectionSybase. Referenced by close(). |
|
|
Definition at line 69 of file Connection.h. |
|
|
Definition at line 70 of file Connection.h. |
|
|
Definition at line 62 of file Connection.h. |
|
|
Definition at line 103 of file Connection.cpp. |
|
|
Definition at line 65 of file Connection.h. |
|
|
Definition at line 174 of file Connection.cpp. |
|
|
Reimplemented in ConnectionDB2, ConnectionODBC, ConnectionOracle, and ConnectionSybase. Referenced by prepareCall(). |
|
|
Reimplemented in ConnectionDB2, ConnectionODBC, ConnectionOracle, and ConnectionSybase. Referenced by prepareStatement(). |
|
|
Definition at line 157 of file Connection.cpp. |
|
|
Definition at line 145 of file Connection.cpp. Referenced by Transaction::doDelete(), Transaction::doInsert(), Transaction::doSelect(), Report::doSelect(), and Transaction::doUpdate(). |
|
|
called by ConnectionPool.returnConnection() right before it wakes up the threads.
Definition at line 140 of file Connection.cpp. Referenced by ConnectionPool::returnConnection(). |
|
|
Reimplemented in ConnectionDB2, ConnectionODBC, ConnectionOracle, and ConnectionSybase. Referenced by DBPage::rollbackConnection(). |
|
|
This is used by ConnectionPool.removeConnection(). It closes all statements and closes the actual JDBC Connection. We implement this in a runnable method so that we can run this in a separate Thread and use a timeout mechanism to avoid deadlock (which was occurring when trying to close a Connection that had a query in progress) Definition at line 55 of file Connection.cpp. |
|
|
Reimplemented in ConnectionDB2, ConnectionODBC, ConnectionOracle, and ConnectionSybase. Referenced by ConnectionPool::getConnection(). |
|
|
Definition at line 66 of file Connection.h. |
|
|
Definition at line 64 of file Connection.h. |
|
|
Definition at line 68 of file Connection.h. |
|
|
Definition at line 23 of file Connection.h. |
|
|
Definition at line 34 of file Connection.h. |
|
|
Definition at line 28 of file Connection.h. |
|
|
Definition at line 27 of file Connection.h. |
|
|
Definition at line 26 of file Connection.h. |
|
|
Definition at line 25 of file Connection.h. |
|
|
Definition at line 31 of file Connection.h. |
1.2.1 written by Dimitri van Heesch,
© 1997-2000