#include <cConnection.h>
Inheritance diagram for Connection:
Public Member Functions | |
~Connection () | |
virtual bool | Sql (const char *sqlCommand) |
virtual bool | Commit () |
virtual bool | Rollback () |
virtual bool | Savepoint (const char *name) |
virtual bool | RollbackToSavepoint (const char *name) |
virtual bool | Disconnect () |
virtual bool | Abort () |
virtual bool | Autocommit (bool ac)=0 |
virtual class Cursor * | _GetNewCursor ()=0 |
virtual Connection & | operator<< (const char *SqlCommand) |
Connection & | operator<< (const class Cmd &Command) |
bool | operator== (const class Connection &DbConn) const |
bool | operator!= (const class Connection &DbConn) const |
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) |
virtual bool | _Open () |
virtual bool | _Prepare (const char *SqlCommand) |
virtual bool | _PreExecBind (const char *varName, const int pos, const void *varAddr, const int varLen, const IopcDataType varType, const bool null=false) |
virtual bool | _Execute () |
virtual bool | _PreFetchBind (const int position, const void *varAddr, const int varLen, const IopcDataType varType, bool *null=NULL) |
virtual bool | _FetchNext () |
virtual bool | _FetchPrev () |
virtual bool | _Close () |
Protected Member Functions | |
Connection (class Database *DB, const char *UserName, const char *Password, const int LocHandle, const int GlobHandle) | |
virtual bool | _Sql (const char *sqlCommand) |
virtual bool | _Commit ()=0 |
virtual bool | _Rollback ()=0 |
virtual bool | _Savepoint (const char *name)=0 |
virtual bool | _RollbackToSavepoint (const char *name)=0 |
virtual bool | _NextOID (long int &nxtoid, long int &nxtsn)=0 |
virtual bool | _NextSN (long int curoid, long int &nxtsn)=0 |
char * | _GetUserName () |
char * | _GetPassword () |
virtual bool | _PreExecBind (const char *VarName, const void *VarAddr, const int VarLen, const char VarType, short *VarInd=NULL) |
virtual bool | _PreFetchBind (const int Position, const void *VarAddr, const int VarLen, const char VarType, short *VarInd=NULL) |
Protected Attributes | |
unsigned short | _Strategies |
char * | _UserName |
char * | _Password |
Database * | _Database |
int | _Handle |
int | _LocalHandle |
Cursor * | _DefaultCursor |
The only "correct" instantiable descendant of this class is currently class Oracle8iConnection. 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.
If macro ALLOW_DIRECT_SQL_SELECTS is defined, functions _Open(), _Prepare(), _PreExecBind(), _Execute(), _PreFetchBind(), _FetchNext(), _FetchPrev() and _Close() are public and user can use them for direct SQL access to the database. By default the macro is not defined.
Methods of this class returns true if OK, false otherwise.
|
|
|
|
|
Processes SQL command (
Reimplemented in OracleConnection. |
|
Commits actual transaction.
Implemented in OracleConnection, and Oracle8iConnection. |
|
Performs rollback of actual transaction.
Implemented in OracleConnection, and Oracle8iConnection. |
|
Creates savepoint with given name ( If your database doesn't support savepoints, feel free to make fake implementation of this function. Implemented in OracleConnection, and Oracle8iConnection. |
|
Performs rollback to savepoint with given name ( If your database doesn't support savepoints, feel free to make fake implementation of this function. Implemented in OracleConnection, and Oracle8iConnection. |
|
Generates new OID and Serial Number for a new object. 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 OracleConnection. |
|
Generates new Serial Number for object with given OID. 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 OracleConnection. |
|
Updates all objects in cache, then calls _Sql().
Reimplemented in OracleConnection. |
|
Saves modified objects to the database, then commits actual transaction.
Reimplemented in OracleConnection. |
|
Performs rollback of actual transaction, then removes all persistent objects from the memory.
Reimplemented in OracleConnection. |
|
Saves modified objects to the database, then creates savepoint.
Reimplemented in OracleConnection. |
|
Performs rollback to savepoint, then destroys all data in memory.
Reimplemented in OracleConnection. |
|
Commits actual transaction, then disconnects from database.
Reimplemented in OracleConnection, and Oracle8iConnection. |
|
Performs rollback of actual transaction, then disconnect from database.
Reimplemented in OracleConnection, and Oracle8iConnection. |
|
Turns on / off autocommit (automatic commit of every SQL data manipulation statement).
Implemented in OracleConnection, and Oracle8iConnection. |
|
Creates and returns new cursor.
Implemented in OracleConnection, and Oracle8iConnection. |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Opens default cursor
|
|
Prepares
|
|
Binds an input variable using default cursor. If Parameter description can be found in documentation of Cursor::_PreExecBind(const char *,const int,const void *,const int,const IopcDataType,bool).
|
|
Using default cursor executes SQL statement, that has been already prepared (see _Prepare()) and its input variables (if any) have been bound (see _PreExecBind()).
|
|
Binds an output variable using default cursor. (_Execute() must be called before first call to this function). This function is called once for every output variable in SQL statement -> typically more than once per statement. Parameter description can be found in documentation of Cursor::_PreFetchBind(const int,const void *,const int,const IopcDataType,bool *)
|
|
Fetches next row using default cursor. Appropriate SQL statement must have been already executed and its output variables have been bound.
|
|
Fetches previous row using default cursor. Appropriate SQL statement must have been already executed and its output variables must have been bound. If the database doesn't support this functionality, throws ObjLibException_NotSupported.
|
|
Closes the default cursor.
|
|
Obsolete version of _PreExecBind() used by POLiTe-style persistent classes. . Use _PreExecBind(const char *,const int,const void *,const int,const IopcDataType,bool) instead. Parameter description can be found in documentation of Cursor::_PreExecBind(const char *,const void *,const int,const char, short *). |
|
Obsolete version of _PreFetchBind() used by POLiTe-style persistent classes. . Use _PreFetchBind(const int,const void *,const int,const IopcDataType,bool *) instead. Parameter description can be found in documentation of Cursor::_PreFetchBind(const int,const void *,const int,const char, short *). |
|
|
|
|
|
|
|
|
|
|
|
|
|
Default cursor.
|