#include <SqlConnection.h>
Inheritance diagram for SqlConnection:
Public Member Functions | |
SqlConnection () | |
DbRetVal | connect (char *user, char *pass) |
opens connection to the sql engine | |
DbRetVal | disconnect () |
closes connection to the database and releases all the resources | |
DbRetVal | commit () |
Commits active transaction. | |
DbRetVal | rollback () |
Aborts the active transaction. | |
DbRetVal | beginTrans (IsolationLevel isoLevel=READ_COMMITTED, TransSyncMode mode=OSYNC) |
Starts a transaction. | |
Connection & | getConnObject () |
bool | isConnectionOpen () |
Friends | |
class | SqlFactory |
Definition at line 26 of file SqlConnection.h.
SqlConnection::SqlConnection | ( | ) | [inline] |
Definition at line 31 of file SqlConnection.h.
References AbsSqlConnection::innerConn.
00031 {innerConn = NULL; isConnOpen = false; }
DbRetVal SqlConnection::beginTrans | ( | IsolationLevel | isoLevel = READ_COMMITTED , |
|
TransSyncMode | mode = OSYNC | |||
) | [inline, virtual] |
Starts a 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. |
Implements AbsSqlConnection.
Definition at line 79 of file SqlConnection.h.
References isoLevel, and Connection::startTransaction().
Referenced by main().
00081 { return conn.startTransaction(isoLevel); }
Here is the call graph for this function:
Here is the caller graph for this function:
DbRetVal SqlConnection::commit | ( | ) | [inline, 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.
Implements AbsSqlConnection.
Definition at line 60 of file SqlConnection.h.
References Connection::commit().
Referenced by main().
Here is the call graph for this function:
Here is the caller graph for this function:
DbRetVal SqlConnection::connect | ( | char * | user, | |
char * | pass | |||
) | [inline, virtual] |
opens connection to the sql engine
user | username for authentication | |
pass | password for authentication |
Implements AbsSqlConnection.
Definition at line 38 of file SqlConnection.h.
References OK, and Connection::open().
Referenced by main().
00038 { 00039 DbRetVal ret = conn.open(user, pass); 00040 if (ret == OK) isConnOpen = true; 00041 return ret; 00042 }
Here is the call graph for this function:
Here is the caller graph for this function:
DbRetVal SqlConnection::disconnect | ( | ) | [inline, virtual] |
closes connection to the database and releases all the resources
Implements AbsSqlConnection.
Definition at line 47 of file SqlConnection.h.
References Connection::close(), and OK.
Referenced by main().
00047 { 00048 DbRetVal ret = conn.close(); 00049 if (ret == OK) isConnOpen = false; 00050 return ret; 00051 }
Here is the call graph for this function:
Here is the caller graph for this function:
Connection& SqlConnection::getConnObject | ( | ) | [inline, virtual] |
Implements AbsSqlConnection.
Definition at line 83 of file SqlConnection.h.
Referenced by SqlStatement::prepare().
00083 { return conn; }
Here is the caller graph for this function:
bool SqlConnection::isConnectionOpen | ( | ) | [inline] |
Definition at line 84 of file SqlConnection.h.
Referenced by SqlStatement::execute(), SqlStatement::fetch(), SqlStatement::fetchAndPrint(), and SqlStatement::prepare().
Here is the caller graph for this function:
DbRetVal SqlConnection::rollback | ( | ) | [inline, 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.
Implements AbsSqlConnection.
Definition at line 69 of file SqlConnection.h.
References Connection::rollback().
Here is the call graph for this function:
friend class SqlFactory [friend] |
Definition at line 84 of file SqlConnection.h.