- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files
- Directories
- Examples

- Class List
- Class Hierarchy
- Class Members

Public Types | Signals | Public Member Functions | Protected Slots | Protected Member Functions | Friends

# QSqlDriver Class Reference

Search for all occurrences

## Detailed Description

Definition at line 68 of file qsqldriver.h.

`#include <qsqldriver.h>`

Inheritance diagram for QSqlDriver:
[legend]

List of all members.

## Public Types
enum | DriverFeature { Transactions, QuerySize, BLOB, Unicode, PreparedQueries, NamedPlaceholders, PositionalPlaceholders, LastInsertId, BatchOperations, SimpleLocking, LowPrecisionNumbers, EventNotifications, FinishQuery, MultipleResultSets }
enum | StatementType { WhereStatement, SelectStatement, UpdateStatement, InsertStatement, DeleteStatement }
enum | IdentifierType { FieldName, TableName }
## Signals
void | notification (const QString &name)
## Public Member Functions
| QSqlDriver (QObject *parent=0)
| ~QSqlDriver ()
virtual bool | isOpen () const
bool | isOpenError () const
virtual bool | beginTransaction ()
virtual bool | commitTransaction ()
virtual bool | rollbackTransaction ()
virtual QStringList | tables (QSql::TableType tableType) const
virtual QSqlIndex | primaryIndex (const QString &tableName) const
virtual QSqlRecord | record (const QString &tableName) const
virtual QString | formatValue (const QSqlField &field, bool trimStrings=false) const
virtual QString | escapeIdentifier (const QString &identifier, IdentifierType type) const
virtual QString | sqlStatement (StatementType type, const QString &tableName, const QSqlRecord &rec, bool preparedStatement) const
QSqlError | lastError () const
virtual QVariant | handle () const
virtual bool | hasFeature (DriverFeature f) const =0
virtual void | close ()=0
virtual QSqlResult * | createResult () const =0
virtual bool | open (const QString &db, const QString &user=QString(), const QString &password=QString(), const QString &host=QString(), int port=-1, const QString &connOpts=QString())=0
bool | subscribeToNotification (const QString &name)
bool | unsubscribeFromNotification (const QString &name)
QStringList | subscribedToNotifications () const
bool | isIdentifierEscaped (const QString &identifier, IdentifierType type) const
QString | stripDelimiters (const QString &identifier, IdentifierType type) const
void | setNumericalPrecisionPolicy (QSql::NumericalPrecisionPolicy precisionPolicy)
QSql::NumericalPrecisionPolicy | numericalPrecisionPolicy () const
## Protected Slots
bool | subscribeToNotificationImplementation (const QString &name)
bool | unsubscribeFromNotificationImplementation (const QString &name)
QStringList | subscribedToNotificationsImplementation () const
bool | isIdentifierEscapedImplementation (const QString &identifier, IdentifierType type) const
QString | stripDelimitersImplementation (const QString &identifier, IdentifierType type) const
## Protected Member Functions
virtual void | setOpen (bool o)
virtual void | setOpenError (bool e)
virtual void | setLastError (const QSqlError &e)
## Friends
class | QSqlDatabase

## Member Enumeration Documentation

enum DriverFeature

Search for all occurrences

Enumerator:

  Transactions | Search for all occurrences
  QuerySize | Search for all occurrences
  BLOB | Search for all occurrences
  Unicode | Search for all occurrences
  PreparedQueries | Search for all occurrences
  NamedPlaceholders | Search for all occurrences
  PositionalPlaceholders | Search for all occurrences
  LastInsertId | Search for all occurrences
  BatchOperations | Search for all occurrences
  SimpleLocking | Search for all occurrences
  LowPrecisionNumbers | Search for all occurrences
  EventNotifications | Search for all occurrences
  FinishQuery | Search for all occurrences
  MultipleResultSets | Search for all occurrences

Definition at line 75 of file qsqldriver.h.

                           { Transactions, QuerySize, BLOB, Unicode, PreparedQueries,
                             NamedPlaceholders, PositionalPlaceholders, LastInsertId,
                             BatchOperations, SimpleLocking, LowPrecisionNumbers,
                             EventNotifications, FinishQuery, MultipleResultSets };

enum StatementType

Search for all occurrences

Enumerator:

  WhereStatement | Search for all occurrences
  SelectStatement | Search for all occurrences
  UpdateStatement | Search for all occurrences
  InsertStatement | Search for all occurrences
  DeleteStatement | Search for all occurrences

Definition at line 80 of file qsqldriver.h.

                           { WhereStatement, SelectStatement, UpdateStatement,
                             InsertStatement, DeleteStatement };

enum IdentifierType

Search for all occurrences

Enumerator:

  FieldName | Search for all occurrences
  TableName | Search for all occurrences

Definition at line 83 of file qsqldriver.h.

    { FieldName, TableName };

## Constructor & Destructor Documentation

QSqlDriver | ( | QObject * | parent = `0` | ) | `[explicit]`

~QSqlDriver | ( |  | ) |

## Member Function Documentation

virtual bool isOpen | ( |  | ) | const `[virtual]`

Search for all occurrences

Reimplemented in QPSQLDriver.

bool isOpenError | ( |  | ) | const

Search for all occurrences

virtual bool beginTransaction | ( |  | ) | `[virtual]`

Search for all occurrences

Reimplemented in QDB2Driver, QIBaseDriver, QMYSQLDriver, QOCIDriver, QODBCDriver, QPSQLDriver, QSQLiteDriver, QSQLite2Driver, and QTDSDriver.

virtual bool commitTransaction | ( |  | ) | `[virtual]`

Search for all occurrences

Reimplemented in QDB2Driver, QIBaseDriver, QMYSQLDriver, QOCIDriver, QODBCDriver, QPSQLDriver, QSQLiteDriver, QSQLite2Driver, and QTDSDriver.

virtual bool rollbackTransaction | ( |  | ) | `[virtual]`

Search for all occurrences

Reimplemented in QDB2Driver, QIBaseDriver, QMYSQLDriver, QOCIDriver, QODBCDriver, QPSQLDriver, QSQLiteDriver, QSQLite2Driver, and QTDSDriver.

virtual QStringList tables | ( | QSql::TableType | tableType | ) | const `[virtual]`

Search for all occurrences

Reimplemented in QDB2Driver, QIBaseDriver, QMYSQLDriver, QOCIDriver, QODBCDriver, QPSQLDriver, QSQLiteDriver, QSQLite2Driver, and QTDSDriver.

virtual QSqlIndex primaryIndex | ( | const QString & | tableName | ) | const `[virtual]`

Search for all occurrences

Reimplemented in QDB2Driver, QIBaseDriver, QMYSQLDriver, QOCIDriver, QODBCDriver, QPSQLDriver, QSQLiteDriver, QSQLite2Driver, and QTDSDriver.

virtual QSqlRecord record | ( | const QString & | tableName | ) | const `[virtual]`

Search for all occurrences

Reimplemented in QDB2Driver, QIBaseDriver, QMYSQLDriver, QOCIDriver, QODBCDriver, QPSQLDriver, QSQLiteDriver, QSQLite2Driver, and QTDSDriver.

virtual QString formatValue | ( | const QSqlField & | field,
|  | bool | trimStrings = `false`
| ) |  | const `[virtual]`

Search for all occurrences

Reimplemented in QDB2Driver, QIBaseDriver, QMYSQLDriver, QOCIDriver, QODBCDriver, QPSQLDriver, and QTDSDriver.

virtual QString escapeIdentifier | ( | const QString & | identifier,
|  | IdentifierType | type
| ) |  | const `[virtual]`

Search for all occurrences

Reimplemented in QDB2Driver, QIBaseDriver, QMYSQLDriver, QOCIDriver, QODBCDriver, QPSQLDriver, QSQLiteDriver, QSQLite2Driver, and QTDSDriver.

virtual QString sqlStatement | ( | StatementType | type,
|  | const QString & | tableName,
|  | const QSqlRecord & | rec,
|  | bool | preparedStatement
| ) |  | const `[virtual]`

Search for all occurrences

QSqlError lastError | ( |  | ) | const

Search for all occurrences

virtual QVariant handle | ( |  | ) | const `[virtual]`

Search for all occurrences

Reimplemented in QDB2Driver, QIBaseDriver, QMYSQLDriver, QOCIDriver, QODBCDriver, QPSQLDriver, QSQLiteDriver, QSQLite2Driver, and QTDSDriver.

virtual bool hasFeature | ( | DriverFeature | f | ) | const `[pure virtual]`

Search for all occurrences

Implemented in QDB2Driver, QIBaseDriver, QMYSQLDriver, QOCIDriver, QODBCDriver, QPSQLDriver, QSQLiteDriver, QSQLite2Driver, and QTDSDriver.

virtual void close | ( |  | ) | `[pure virtual]`

Search for all occurrences

Implemented in QDB2Driver, QIBaseDriver, QMYSQLDriver, QOCIDriver, QODBCDriver, QPSQLDriver, QSQLiteDriver, QSQLite2Driver, and QTDSDriver.

virtual QSqlResult* createResult | ( |  | ) | const `[pure virtual]`

Search for all occurrences

Implemented in QDB2Driver, QIBaseDriver, QMYSQLDriver, QOCIDriver, QODBCDriver, QPSQLDriver, QSQLiteDriver, QSQLite2Driver, and QTDSDriver.

virtual bool open | ( | const QString & | db,
|  | const QString & | user = `QString()`,
|  | const QString & | password = `QString()`,
|  | const QString & | host = `QString()`,
|  | int | port = `-1`,
|  | const QString & | connOpts = `QString()`
| ) |  | `[pure virtual]`

Search for all occurrences

Implemented in QDB2Driver, QIBaseDriver, QMYSQLDriver, QOCIDriver, QODBCDriver, QPSQLDriver, QSQLiteDriver, QSQLite2Driver, and QTDSDriver.

bool subscribeToNotification | ( | const QString & | name | ) |

Search for all occurrences

bool unsubscribeFromNotification | ( | const QString & | name | ) |

Search for all occurrences

QStringList subscribedToNotifications | ( |  | ) | const

Search for all occurrences

bool isIdentifierEscaped | ( | const QString & | identifier,
|  | IdentifierType | type
| ) |  | const

Search for all occurrences

QString stripDelimiters | ( | const QString & | identifier,
|  | IdentifierType | type
| ) |  | const

Search for all occurrences

void setNumericalPrecisionPolicy | ( | QSql::NumericalPrecisionPolicy | precisionPolicy | ) |

Search for all occurrences

QSql::NumericalPrecisionPolicy numericalPrecisionPolicy | ( |  | ) | const

Search for all occurrences

void notification | ( | const QString & | name | ) | `[signal]`

Search for all occurrences

virtual void setOpen | ( | bool | o | ) | `[protected, virtual]`

Search for all occurrences

virtual void setOpenError | ( | bool | e | ) | `[protected, virtual]`

Search for all occurrences

virtual void setLastError | ( | const QSqlError & | e | ) | `[protected, virtual]`

Search for all occurrences

bool subscribeToNotificationImplementation | ( | const QString & | name | ) | `[protected, slot]`

Search for all occurrences

Reimplemented in QIBaseDriver, and QPSQLDriver.

bool unsubscribeFromNotificationImplementation | ( | const QString & | name | ) | `[protected, slot]`

Search for all occurrences

Reimplemented in QIBaseDriver, and QPSQLDriver.

QStringList subscribedToNotificationsImplementation | ( |  | ) | const `[protected, slot]`

Search for all occurrences

Reimplemented in QIBaseDriver, and QPSQLDriver.

bool isIdentifierEscapedImplementation | ( | const QString & | identifier,
|  | IdentifierType | type
| ) |  | const `[protected, slot]`

Search for all occurrences

Reimplemented in QMYSQLDriver, and QODBCDriver.

QString stripDelimitersImplementation | ( | const QString & | identifier,
|  | IdentifierType | type
| ) |  | const `[protected, slot]`

Search for all occurrences

## Friends And Related Function Documentation

friend class QSqlDatabase `[friend]`

Search for all occurrences

Definition at line 70 of file qsqldriver.h.

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

- QtSql/qsqldriver.h

QSqlDriver QSqlDriver QSqlDriver QSqlDriver QSqlDriver QSqlDriver QSqlDriver QSqlDriver QSqlDriver QSqlDriver
QSqlDriver QSqlDriver QSqlDriver QSqlDriver QSqlDriver QSqlDriver QSqlDriver QSqlDriver QSqlDriver QSqlDriver