#include <AbsSqlConnection.h>
Inheritance diagram for AbsSqlConnection:
Public Member Functions | |
void | setInnerConnection (AbsSqlConnection *conn) |
AbsSqlConnection * | getInnerConnection () |
virtual Connection & | getConnObject ()=0 |
virtual DbRetVal | connect (char *user, char *pass)=0 |
opens connection to the sql engine | |
virtual DbRetVal | disconnect ()=0 |
closes connection to the sql engine and releases all the resources | |
virtual DbRetVal | commit ()=0 |
Commits active transaction. | |
virtual DbRetVal | rollback ()=0 |
Aborts the active transaction. | |
virtual DbRetVal | beginTrans (IsolationLevel isoLevel=READ_COMMITTED, TransSyncMode mode=OSYNC)=0 |
Starts a new transaction. | |
virtual | ~AbsSqlConnection () |
Protected Attributes | |
AbsSqlConnection * | innerConn |
}
It represents the database connection to the sql engine.
All database operations shall be done within the context of the connection.
Application should first create object of this class to accessing the database
through SQL Engine. Each connection has only one active transaction at any given point of time, all
operations which happen using this connection object will be done as part of that
transaction.
Note:
SERIALIZABLE isolation level is not supported.
Definition at line 50 of file AbsSqlConnection.h.
virtual AbsSqlConnection::~AbsSqlConnection | ( | ) | [inline, virtual] |
virtual DbRetVal AbsSqlConnection::beginTrans | ( | IsolationLevel | isoLevel = READ_COMMITTED , |
|
TransSyncMode | mode = OSYNC | |||
) | [pure virtual] |
Starts a new transaction.
The previous transaction should be either committed or rollback
before beginTrans is called.
Applications are required to start transaction before they attempt any
database operation.
isoLevel | isolation level. Default is read committed. |
Implemented in SqlConnection, SqlGwConnection, SqlLogConnection, and SqlOdbcConnection.
Referenced by SqlLogConnection::beginTrans(), SqlGwConnection::beginTrans(), getRecordsFromTargetDb(), Java_csql_jdbc_JSqlConnection_beginTrans(), main(), CSqlOdbcDbc::SQLConnect(), CSqlOdbcDbc::SQLEndTran(), verifyCount(), and verifyPrimKeyFldVal().
Here is the caller graph for this function:
virtual DbRetVal AbsSqlConnection::commit | ( | ) | [pure virtual] |
Commits active transaction.
It makes all the changes made in the current transaction permanent and
it also releases the locks held by the current transaction.
After a transaction commits, application is required to start another
transaction for further database operations.
Implemented in SqlConnection, SqlGwConnection, SqlLogConnection, and SqlOdbcConnection.
Referenced by SqlLogConnection::commit(), SqlGwConnection::commit(), getRecordsFromTargetDb(), Java_csql_jdbc_JSqlConnection_commit(), main(), CSqlOdbcDbc::SQLDisconnect(), CSqlOdbcDbc::SQLEndTran(), verifyCount(), and verifyPrimKeyFldVal().
Here is the caller graph for this function:
virtual DbRetVal AbsSqlConnection::connect | ( | char * | user, | |
char * | pass | |||
) | [pure virtual] |
opens connection to the sql engine
user | username for authentication | |
pass | password for authentication |
Implemented in SqlConnection, SqlGwConnection, SqlLogConnection, and SqlOdbcConnection.
Referenced by SqlLogConnection::connect(), SqlGwConnection::connect(), SqlGwConnection::connectAdapterIfNotConnected(), SqlGwConnection::connectCSqlIfNotConnected(), Java_csql_jdbc_JSqlConnection_connect(), main(), CSqlOdbcDbc::SQLConnect(), verifyCount(), and verifyPrimKeyFldVal().
Here is the caller graph for this function:
virtual DbRetVal AbsSqlConnection::disconnect | ( | ) | [pure virtual] |
closes connection to the sql engine and releases all the resources
Implemented in SqlConnection, SqlGwConnection, SqlLogConnection, and SqlOdbcConnection.
Referenced by SqlLogConnection::connect(), SqlLogConnection::disconnect(), SqlGwConnection::disconnect(), Java_csql_jdbc_JSqlConnection_disconnect(), main(), and CSqlOdbcDbc::SQLDisconnect().
Here is the caller graph for this function:
virtual Connection& AbsSqlConnection::getConnObject | ( | ) | [pure virtual] |
Implemented in SqlConnection, SqlGwConnection, SqlLogConnection, and SqlOdbcConnection.
AbsSqlConnection* AbsSqlConnection::getInnerConnection | ( | ) | [inline] |
virtual DbRetVal AbsSqlConnection::rollback | ( | ) | [pure virtual] |
Aborts the active transaction.
undo all the changes made in the current transaction and it also
releases the locks held by the current transaction.
After a transaction rollback, application is required to start another
transaction for further database operations.
Implemented in SqlConnection, SqlGwConnection, SqlLogConnection, and SqlOdbcConnection.
Referenced by getRecordsFromTargetDb(), Java_csql_jdbc_JSqlConnection_rollback(), SqlLogConnection::rollback(), SqlGwConnection::rollback(), and CSqlOdbcDbc::SQLEndTran().
Here is the caller graph for this function:
void AbsSqlConnection::setInnerConnection | ( | AbsSqlConnection * | conn | ) | [inline] |
Definition at line 55 of file AbsSqlConnection.h.
References conn, and innerConn.
Referenced by SqlFactory::createConnection().
Here is the caller graph for this function:
AbsSqlConnection* AbsSqlConnection::innerConn [protected] |
Definition at line 53 of file AbsSqlConnection.h.
Referenced by SqlLogConnection::beginTrans(), SqlGwConnection::beginTrans(), SqlLogConnection::commit(), SqlGwConnection::commit(), SqlLogConnection::connect(), SqlGwConnection::connect(), SqlGwConnection::connectCSqlIfNotConnected(), SqlLogConnection::disconnect(), SqlGwConnection::disconnect(), getInnerConnection(), SqlLogConnection::rollback(), SqlGwConnection::rollback(), setInnerConnection(), SqlConnection::SqlConnection(), SqlGwConnection::SqlGwConnection(), SqlLogConnection::SqlLogConnection(), and SqlOdbcConnection::SqlOdbcConnection().