#include <cDatabase.h>
Inheritance diagram for Database:
Public Member Functions | |
Database (const char *ConnectString=NULL) | |
virtual | ~Database () |
virtual bool | Commit () |
virtual bool | Rollback () |
virtual class Connection * | Connect (const char *UserName, const char *Password)=0 |
virtual bool | WriteDDL (std::ofstream &S)=0 |
virtual char * | ColumnTypeDDL (char colType, int colLength)=0 |
virtual bool | Assign (const char *ConnectString) |
virtual enum UpdatingStrategy | CurrentUpdatingStrategy () const |
virtual bool | SetUpdatingStrategy (enum UpdatingStrategy anUpdateStrategy) |
virtual enum WaitingStrategy | CurrentWaitingStrategy () const |
virtual bool | SetWaitingStrategy (enum WaitingStrategy aWaitingStrategy) |
virtual enum LockingStrategy | CurrentLockingStrategy () const |
virtual bool | SetLockingStrategy (enum LockingStrategy aLockingStrategy) |
virtual enum ReadingStrategy | CurrentReadingStrategy () const |
virtual bool | SetReadingStrategy (enum ReadingStrategy aReadingStrategy) |
Protected Member Functions | |
virtual bool | _Commit () |
virtual bool | _Rollback () |
bool | _FindFreeConnectionHandles (int &LocHandle, int &GlobHandle) |
void | _DisposeConnectionHandles (int &LocHandle, int &GlobHandle) |
Protected Attributes | |
unsigned short | _Strategies |
char * | _ConnectString |
Connection * | _Connections [MAX_CONNECTION_PER_DATABASE] |
int | _FreeConnections [MAX_CONNECTION_PER_DATABASE] |
int | _FirstFreeConnection |
Static Protected Attributes | |
Connection * | _AllConnections [MAX_CONNECTION] |
int | _FreeAllConnections [MAX_CONNECTION] |
int | _FirstFreeAllConnection |
bool | runAfterConnectHandler = true |
int(* | afterConnectHandler )(Connection *connection) |
The only "correct" instantiable descendant of this class is currently class Oracle8iDatabase. If you want to implement support for another database please have a look at that class.
This class was nearly undocumented in POLiTe - a few of old comments can be found in source code - not in doxygen. I (Josef Troch) have documented all "interface" (i.e. pure virtual) functions of this class and also put a few words to other important methods. Remaining members were left undocumented.
Methods of this class returns true if OK, false otherwise.
|
Constructor.
|
|
Destructor - disconnects all connections to this database (Connection::Disconnect()).
|
|
Performs commit on all connections to the database immediately (modified objects are not saved into DB).
Reimplemented in OracleDatabase. |
|
Performs rollback on all connections to the database (doesn't destroy copies in memory).
Reimplemented in OracleDatabase. |
|
Saves all modified objects to DB, then performs commit on all connections to the database.
Reimplemented in OracleDatabase. |
|
Performs rollback on all connections to the database, then destroys all copies in memory.
Reimplemented in OracleDatabase. |
|
Creates new connection to the database After successful connection this function should call afterConnectHandler if runAfterConnectHandler is set. Implementation should return ObjLibException_ConnectionError in case of error.
Implemented in OracleDatabase, and Oracle8iDatabase. |
|
Generates DDL statements needed for old POLiTe style persistence to work Obsolete function. IopcPersistentObject ancestors don't need this generated DDL statements. So you can make fake implementation of this function if you don't need to support POLiTe-style persistent classes.
Implemented in OracleDatabase, and Oracle8iDatabase. |
|
Returns correct database column type for given attribute type. Obsolete function used by POLiTe-style persistent classes. IopcPersistentObject ancestors don't use this function. So you can make fake implementation of this function if you don't need to support POLiTe-style persistent classes.
Implemented in OracleDatabase, and Oracle8iDatabase. |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Array of existing connections to this database.
|
|
|
|
|
|
Array of existing connections to all databases.
|
|
|
|
|
|
Should afterConnectHandler be used?
|
|
Pointer to the function that is executed at the end of Connect() if runAfterConnectHandler is set. If afterConnectHandler returns 0, runAfterConnectHandler should be set to false. |