Main Page | Modules | Class Hierarchy | Alphabetical List | Class List | File List | Class Members | File Members | Related Pages

Oracle8iDatabase Class Reference

Abstraction of a database that is accessed using Oracle 8i OCI. More...

#include <Oracle8iDatabase.h>

Inheritance diagram for Oracle8iDatabase:

Inheritance graph
Collaboration diagram for Oracle8iDatabase:

Collaboration graph
List of all members.

Public Member Functions

 Oracle8iDatabase (const char *connectString=NULL)
 ~Oracle8iDatabase ()
virtual ConnectionConnect (const char *userName, const char *password)
virtual bool WriteDDL (std::ofstream &S)
virtual char * ColumnTypeDDL (char colType, int colLength)

Protected Member Functions

int processOCIError (int ociRetVal, const char *ociFunctionName, const char *myFunctionName, bool useEnvHandle=0)

Static Protected Member Functions

void logDebugMessage (const char *formatString, const char *param1="")

Protected Attributes

OCIEnv * ociEnvironment
OCIError * errorHandle
bool errorInitializingOCI

Detailed Description

Abstraction of a database that is accessed using Oracle 8i OCI.

Methods of this class return true if OK, false otherwise (if not explicitly said something different). In case of connection error they throw exception ObjLibException_ConnectionError.

See also:
Oracle8iSqlStatements, Oracle8iConnection, Oracle8iCursor

Constructor & Destructor Documentation

Oracle8iDatabase::Oracle8iDatabase const char *  connectString = NULL  ) 

Creates a Database object assigned to a real database.

connectString Service name of database to connect to.

Oracle8iDatabase::~Oracle8iDatabase  ) 

Destructor - disconnects all connections to this database (Connection::Disconnect()), frees some handles.

Member Function Documentation

Connection * Oracle8iDatabase::Connect const char *  userName,
const char *  password

Creates new connection to the database

After successful connection this function calls afterConnectHandler if runAfterConnectHandler is set.

In case of error throws ObjLibException_ConnectionError.
userName User name to connect as.
password Password for user userName.
Created Oracle8iConnection object.

Implements Database.

bool Oracle8iDatabase::WriteDDL std::ofstream &  S  )  [virtual]

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.

S Stream to output DDL statements into.

Implements Database.

char * Oracle8iDatabase::ColumnTypeDDL char  colType,
int  colLength

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.

colType Type of the attribute (TYPE_INT etc.)
colLength Length of the attribute (for int-s etc. sizeof())
See also:

Implements Database.

int Oracle8iDatabase::processOCIError int  ociRetVal,
const char *  ociFunctionName,
const char *  myFunctionName,
bool  useEnvHandle = 0
[inline, protected]

Arbitrary function for error handling - calls processOCIErrorGlobal() passing it given parameters and some class specific values.

ociRetVal Return value of OCI function to handle its (possible) error.
ociFunctionName Name of the OCI function.
myFunctionName Name of the member, who called the OCI function.
useEnvHandle Set if OCIErrorGet() is to be called on ociEnvironment instead of on errorHandle.
Return value from processOCIErrorGlobal()

void Oracle8iDatabase::logDebugMessage const char *  formatString,
const char *  param1 = ""
[inline, static, protected]

Logs (using logmsg()) given message if C_ORACLEDATABASE_TRACE is set, otherwise does nothing.

formatString String with message to be logged - can contains only one "%s" specifier for inserting string param1.
param1 Optional string to be inserted into formatString.

Member Data Documentation

OCIEnv* Oracle8iDatabase::ociEnvironment [protected]

Pointer to OCI Environment handle (see OCIEnvCreate() in Oracle documentation).

OCIError* Oracle8iDatabase::errorHandle [protected]

Pointer to error handle to be passed to OCIErrorGet() for diagnostic information in case of error.

bool Oracle8iDatabase::errorInitializingOCI [protected]

Set if an error occured in constructor while initializing Oracle 8i OCI. If set, Connect() fails.

The documentation for this class was generated from the following files:
Generated on Wed Aug 11 22:36:07 2004 for IOPC by Doxygen 1.3.6