#include <QOpenOCCI.h>
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 |
Definition at line 230 of file QOpenOCCI.h.
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.
bool QOpenOCCIDriver::hasFeature | ( | DriverFeature | feature | ) | const |
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.
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 |
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 |
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] |
void QOpenOCCIDriver::closeConnection | ( | ) | [private] |
const char * QOpenOCCIDriver::CONNECTION_FAILED = "QOpenOCCI: Connection Failed" [static] |
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] |
const char * QOpenOCCIDriver::ROLLBACK_FAILED = "QOpenOCCI: Rollback Failed" [static] |
const char * QOpenOCCIDriver::PREFETCH_MEM_KEY = "Prefetch_Memory" [static] |
const char * QOpenOCCIDriver::PREFETCH_ROWS_KEY = "Prefetch_Rows" [static] |
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().