QOpenOCCIDriver Class Reference

Main Driver class. More...

#include <QOpenOCCI.h>

List of all members.

Public Member Functions

 QOpenOCCIDriver ()
 Default constructor that sets up the OCCI environment.
 ~QOpenOCCIDriver ()
 Default destructor that terminates the OCCI environment.
bool hasFeature (DriverFeature) const
bool open (const QString &db, const QString &user, const QString &password, const QString &host, int port=1521, const QString &options="")
void close ()
QSqlQuery createQuery () const
QSqlResult * createResult () const
bool beginTransaction ()
bool commitTransaction ()
bool rollbackTransaction ()

Static Public Attributes

static const char * CONNECTION_FAILED = "QOpenOCCI: Connection Failed"
static const char * CONNECTION_ALREADY_OPEN = "QOpenOCCI: Connection already open"
static const char * COMMIT_FAILED = "QOpenOCCI: Commit Failed"
static const char * ROLLBACK_FAILED = "QOpenOCCI: Rollback Failed"
static const char * PREFETCH_MEM_KEY = "Prefetch_Memory"
static const char * PREFETCH_ROWS_KEY = "Prefetch_Rows"
static const char * RESULT_FAILED = "QOpenOCCI: Result create failed"

Private Member Functions

void closeConnection ()

Static Private Member Functions

static void ErrHandle (OCI_Error *err)

Private Attributes

OCI_Connection * mConnection
 Oracle Connection object.
QMap< QString, QString > mOptionMap
 Used to hold connection options passed to open.

Static Private Attributes

static int driverCount = 0


Detailed Description

Main Driver class.

Definition at line 230 of file QOpenOCCI.h.


Constructor & Destructor Documentation

QOpenOCCIDriver::QOpenOCCIDriver (  ) 

Default constructor that sets up the OCCI environment.

Definition at line 29 of file QOpenOCCIDriver.cpp.

QOpenOCCIDriver::~QOpenOCCIDriver (  ) 

Default destructor that terminates the OCCI environment.

Definition at line 40 of file QOpenOCCIDriver.cpp.


Member Function Documentation

bool QOpenOCCIDriver::hasFeature ( DriverFeature  feature  )  const

See also:
http://doc.trolltech.com/4.3/qsqldriver.html#hasFeature
Returns:
TRUE for QSqlDriver::Transactions, QSqlDriver::BLOB, QSqlDriver::PreparedQueries, and QSqlDriver::PositionalPlaceholders

Definition at line 141 of file QOpenOCCIDriver.cpp.

bool QOpenOCCIDriver::open ( const QString &  db,
const QString &  user,
const QString &  password,
const QString &  host,
int  port = 1521,
const QString &  options = "" 
)

Connects to the database using the given arguments. The options string can be used to optimize how the driver handle OCCI connects by setting Prefetch_Rows and Prefetch_Memory. For example setting options = "Prefetch_Rows=250;Prefetch_Memory=1048576" would allow the driver to prefetch up to 250 rows or 1MB of data. The defaults are 100 and 1048576.

See also:
http://doc.trolltech.com/4.3/qsqldriver.html#open
Parameters:
db The name or SID of the database to connect to.
user Username
password Password
host FQDN or IP address of the host. Ex 127.0.0.1 or db.server.net
port Port to connect to. 1521 should be fine in most cases
options Semicolon seperated string of KEY=VALUE options. See detailed description
Returns:
TRUE if database opened correctly else FALSE

Definition at line 60 of file QOpenOCCIDriver.cpp.

void QOpenOCCIDriver::close (  )  [inline]

Definition at line 263 of file QOpenOCCI.h.

QSqlQuery QOpenOCCIDriver::createQuery (  )  const

Definition at line 116 of file QOpenOCCIDriver.cpp.

QSqlResult * QOpenOCCIDriver::createResult (  )  const

Definition at line 121 of file QOpenOCCIDriver.cpp.

Referenced by createQuery().

bool QOpenOCCIDriver::beginTransaction (  ) 

Definition at line 155 of file QOpenOCCIDriver.cpp.

bool QOpenOCCIDriver::commitTransaction (  ) 

Definition at line 161 of file QOpenOCCIDriver.cpp.

bool QOpenOCCIDriver::rollbackTransaction (  ) 

Definition at line 174 of file QOpenOCCIDriver.cpp.

void QOpenOCCIDriver::ErrHandle ( OCI_Error *  err  )  [static, private]

Definition at line 45 of file QOpenOCCIDriver.cpp.

Referenced by QOpenOCCIDriver().

void QOpenOCCIDriver::closeConnection (  )  [private]

Definition at line 52 of file QOpenOCCIDriver.cpp.

Referenced by open().


Member Data Documentation

const char * QOpenOCCIDriver::CONNECTION_FAILED = "QOpenOCCI: Connection Failed" [static]

Definition at line 271 of file QOpenOCCI.h.

Referenced by open().

const char * QOpenOCCIDriver::CONNECTION_ALREADY_OPEN = "QOpenOCCI: Connection already open" [static]

Definition at line 272 of file QOpenOCCI.h.

const char * QOpenOCCIDriver::COMMIT_FAILED = "QOpenOCCI: Commit Failed" [static]

Definition at line 273 of file QOpenOCCI.h.

Referenced by commitTransaction().

const char * QOpenOCCIDriver::ROLLBACK_FAILED = "QOpenOCCI: Rollback Failed" [static]

Definition at line 274 of file QOpenOCCI.h.

Referenced by rollbackTransaction().

const char * QOpenOCCIDriver::PREFETCH_MEM_KEY = "Prefetch_Memory" [static]

Definition at line 275 of file QOpenOCCI.h.

Referenced by createResult().

const char * QOpenOCCIDriver::PREFETCH_ROWS_KEY = "Prefetch_Rows" [static]

Definition at line 276 of file QOpenOCCI.h.

Referenced by createResult().

const char * QOpenOCCIDriver::RESULT_FAILED = "QOpenOCCI: Result create failed" [static]

Definition at line 277 of file QOpenOCCI.h.

int QOpenOCCIDriver::driverCount = 0 [static, private]

Definition at line 282 of file QOpenOCCI.h.

Referenced by QOpenOCCIDriver(), and ~QOpenOCCIDriver().

OCI_Connection* QOpenOCCIDriver::mConnection [private]

Oracle Connection object.

Definition at line 284 of file QOpenOCCI.h.

Referenced by closeConnection(), commitTransaction(), createResult(), open(), and rollbackTransaction().

QMap<QString, QString> QOpenOCCIDriver::mOptionMap [private]

Used to hold connection options passed to open.

Definition at line 286 of file QOpenOCCI.h.

Referenced by createResult(), and open().


The documentation for this class was generated from the following files:
Generated on Tue Mar 18 22:47:11 2008 for QOpenOCCI by  doxygen 1.5.3