| QxOrm 1.1.7 C++ Object Relational Mapping library

- Main Page
- Modules
- Namespaces
- Classes
- Files
- Directories

- Class List
- Class Index
- Class Hierarchy
- Class Members

Public Types | Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes | Friends
qx::QxSqlDatabase Class Reference
QxDao : QxOrm library database communication used by persistence engine (ORM - Object Relational Mapping)

qx::QxSqlDatabase : define all parameters to connect to database and retrieve a valid connection by thread (this class is a singleton and is thread-safe) More...

`#include <QxSqlDatabase.h>`

Inheritance diagram for qx::QxSqlDatabase:

List of all members.

## Public Types
enum | ph_style { ph_style_question_mark, ph_style_2_point_name, ph_style_at_name }
## Public Member Functions
QString | getDriverName () const
QString | getConnectOptions () const
QString | getDatabaseName () const
QString | getUserName () const
QString | getPassword () const
QString | getHostName () const
int | getPort () const
bool | getTraceSqlQuery () const
bool | getTraceSqlRecord () const
ph_style | getSqlPlaceHolderStyle () const
void | setDriverName (const QString &s)
void | setConnectOptions (const QString &s)
void | setDatabaseName (const QString &s)
void | setUserName (const QString &s)
void | setPassword (const QString &s)
void | setHostName (const QString &s)
void | setPort (int i)
void | setTraceSqlQuery (bool b)
void | setTraceSqlRecord (bool b)
void | setSqlPlaceHolderStyle (ph_style e)
## Static Public Member Functions
static QSqlDatabase | getDatabase ()
## Private Member Functions
| QxSqlDatabase ()
virtual | ~QxSqlDatabase ()
QSqlDatabase | getDatabaseByCurrThreadId ()
QSqlDatabase | createDatabase ()
void | displayLastError (const QSqlDatabase &db, const QString &sDesc) const
QString | formatLastError (const QSqlDatabase &db) const
bool | isValid () const
## Private Attributes
QHash< Qt::HANDLE, QString > | m_lstDbByThread
| Collection of databases connexions by thread id.
QMutex | m_oDbMutex
| Mutex => 'QxSqlDatabase' is thread-safe.
QString | m_sDriverName
| Driver name to connect to database.
QString | m_sConnectOptions
| Connect options to database.
QString | m_sDatabaseName
| Database name.
QString | m_sUserName
| Connection's user name.
QString | m_sPassword
| Connection's password.
QString | m_sHostName
| Connection's host name.
int | m_iPort
| Connection's port number.
bool | m_bTraceSqlQuery
| Trace each sql query executed.
bool | m_bTraceSqlRecord
| Trace each sql record.
ph_style | m_ePlaceHolderStyle
| Place holder style to build sql query.
## Friends
class | QxSingleton< QxSqlDatabase >

## Detailed Description

qx::QxSqlDatabase : define all parameters to connect to database and retrieve a valid connection by thread (this class is a singleton and is thread-safe)

Definition at line 57 of file QxSqlDatabase.h.

## Member Enumeration Documentation

enum qx::QxSqlDatabase::ph_style

Enumerator:

  ph_style_question_mark |
  ph_style_2_point_name |
  ph_style_at_name |

Definition at line 64 of file QxSqlDatabase.h.

## Constructor & Destructor Documentation

qx::QxSqlDatabase::QxSqlDatabase | ( |  | ) | `[inline, private]`

Definition at line 83 of file QxSqlDatabase.h.

virtual qx::QxSqlDatabase::~QxSqlDatabase | ( |  | ) | `[inline, private, virtual]`

Definition at line 84 of file QxSqlDatabase.h.

## Member Function Documentation

QSqlDatabase qx::QxSqlDatabase::createDatabase | ( |  | ) | `[private]`

void qx::QxSqlDatabase::displayLastError | ( | const QSqlDatabase & | db,
|  | const QString & | sDesc
| ) |  | const`[private]`

QString qx::QxSqlDatabase::formatLastError | ( | const QSqlDatabase & | db | ) | const`[private]`

QString qx::QxSqlDatabase::getConnectOptions | ( |  | ) | const`[inline]`

Definition at line 89 of file QxSqlDatabase.h.

static QSqlDatabase qx::QxSqlDatabase::getDatabase | ( |  | ) | `[inline, static]`

Definition at line 110 of file QxSqlDatabase.h.

QSqlDatabase qx::QxSqlDatabase::getDatabaseByCurrThreadId | ( |  | ) | `[private]`

QString qx::QxSqlDatabase::getDatabaseName | ( |  | ) | const`[inline]`

Definition at line 90 of file QxSqlDatabase.h.

QString qx::QxSqlDatabase::getDriverName | ( |  | ) | const`[inline]`

Definition at line 88 of file QxSqlDatabase.h.

QString qx::QxSqlDatabase::getHostName | ( |  | ) | const`[inline]`

Definition at line 93 of file QxSqlDatabase.h.

QString qx::QxSqlDatabase::getPassword | ( |  | ) | const`[inline]`

Definition at line 92 of file QxSqlDatabase.h.

int qx::QxSqlDatabase::getPort | ( |  | ) | const`[inline]`

Definition at line 94 of file QxSqlDatabase.h.

ph_style qx::QxSqlDatabase::getSqlPlaceHolderStyle | ( |  | ) | const`[inline]`

Definition at line 97 of file QxSqlDatabase.h.

bool qx::QxSqlDatabase::getTraceSqlQuery | ( |  | ) | const`[inline]`

Definition at line 95 of file QxSqlDatabase.h.

bool qx::QxSqlDatabase::getTraceSqlRecord | ( |  | ) | const`[inline]`

Definition at line 96 of file QxSqlDatabase.h.

QString qx::QxSqlDatabase::getUserName | ( |  | ) | const`[inline]`

Definition at line 91 of file QxSqlDatabase.h.

bool qx::QxSqlDatabase::isValid | ( |  | ) | const`[inline, private]`

Definition at line 120 of file QxSqlDatabase.h.

void qx::QxSqlDatabase::setConnectOptions | ( | const QString & | s | ) | `[inline]`

Definition at line 100 of file QxSqlDatabase.h.

void qx::QxSqlDatabase::setDatabaseName | ( | const QString & | s | ) | `[inline]`

Definition at line 101 of file QxSqlDatabase.h.

void qx::QxSqlDatabase::setDriverName | ( | const QString & | s | ) | `[inline]`

Definition at line 99 of file QxSqlDatabase.h.

void qx::QxSqlDatabase::setHostName | ( | const QString & | s | ) | `[inline]`

Definition at line 104 of file QxSqlDatabase.h.

void qx::QxSqlDatabase::setPassword | ( | const QString & | s | ) | `[inline]`

Definition at line 103 of file QxSqlDatabase.h.

void qx::QxSqlDatabase::setPort | ( | int | i | ) | `[inline]`

Definition at line 105 of file QxSqlDatabase.h.

void qx::QxSqlDatabase::setSqlPlaceHolderStyle | ( | ph_style | e | ) | `[inline]`

Definition at line 108 of file QxSqlDatabase.h.

void qx::QxSqlDatabase::setTraceSqlQuery | ( | bool | b | ) | `[inline]`

Definition at line 106 of file QxSqlDatabase.h.

void qx::QxSqlDatabase::setTraceSqlRecord | ( | bool | b | ) | `[inline]`

Definition at line 107 of file QxSqlDatabase.h.

void qx::QxSqlDatabase::setUserName | ( | const QString & | s | ) | `[inline]`

Definition at line 102 of file QxSqlDatabase.h.

## Friends And Related Function Documentation

friend class QxSingleton< QxSqlDatabase >`[friend]`

Definition at line 60 of file QxSqlDatabase.h.

## Member Data Documentation

bool qx::QxSqlDatabase::m_bTraceSqlQuery`[private]`

Trace each sql query executed.

Definition at line 77 of file QxSqlDatabase.h.

bool qx::QxSqlDatabase::m_bTraceSqlRecord`[private]`

Trace each sql record.

Definition at line 78 of file QxSqlDatabase.h.

ph_style qx::QxSqlDatabase::m_ePlaceHolderStyle`[private]`

Place holder style to build sql query.

Definition at line 79 of file QxSqlDatabase.h.

int qx::QxSqlDatabase::m_iPort`[private]`

Connection's port number.

Definition at line 76 of file QxSqlDatabase.h.

QHash<Qt::HANDLE, QString> qx::QxSqlDatabase::m_lstDbByThread`[private]`

Collection of databases connexions by thread id.

Definition at line 68 of file QxSqlDatabase.h.

QMutex qx::QxSqlDatabase::m_oDbMutex`[private]`

Mutex => 'QxSqlDatabase' is thread-safe.

Definition at line 69 of file QxSqlDatabase.h.

QString qx::QxSqlDatabase::m_sConnectOptions`[private]`

Connect options to database.

Definition at line 71 of file QxSqlDatabase.h.

QString qx::QxSqlDatabase::m_sDatabaseName`[private]`

Database name.

Definition at line 72 of file QxSqlDatabase.h.

QString qx::QxSqlDatabase::m_sDriverName`[private]`

Driver name to connect to database.

Definition at line 70 of file QxSqlDatabase.h.

QString qx::QxSqlDatabase::m_sHostName`[private]`

Connection's host name.

Definition at line 75 of file QxSqlDatabase.h.

QString qx::QxSqlDatabase::m_sPassword`[private]`

Connection's password.

Definition at line 74 of file QxSqlDatabase.h.

QString qx::QxSqlDatabase::m_sUserName`[private]`

Connection's user name.

Definition at line 73 of file QxSqlDatabase.h.

The documentation for this class was generated from the following file:

- D:/Dvlp/_Perso/QxOrm/include/QxDao/QxSqlDatabase.h

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines