AbsSqlConnection Class Reference

{ Represents a database connection to sql engine. More...

#include <AbsSqlConnection.h>

Inheritance diagram for AbsSqlConnection:

Inheritance graph
[legend]
Collaboration diagram for AbsSqlConnection:

Collaboration graph
[legend]

Public Member Functions

void setInnerConnection (AbsSqlConnection *conn)
AbsSqlConnectiongetInnerConnection ()
virtual ConnectiongetConnObject ()=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

AbsSqlConnectioninnerConn

Detailed Description

{ Represents a database connection to sql engine.

}

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.


Constructor & Destructor Documentation

virtual AbsSqlConnection::~AbsSqlConnection (  )  [inline, virtual]

Definition at line 99 of file AbsSqlConnection.h.

00099 {}


Member Function Documentation

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.

Parameters:
isoLevel isolation level. Default is read committed.
Returns:
DbRetVal

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.

Returns:
DbRetVal

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

Parameters:
user username for authentication
pass password for authentication
Returns:
DbRetVal

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

Returns:
DbRetVal

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]

Definition at line 56 of file AbsSqlConnection.h.

References innerConn.

00056 { return innerConn; }

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.

Returns:
DbRetVal

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().

00055 { innerConn = conn; }

Here is the caller graph for this function:


Field Documentation

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().


The documentation for this class was generated from the following file:
Generated on Mon Jun 9 22:43:01 2008 for csql by  doxygen 1.4.7