Logo Search packages:      
Sourcecode: qt4-x11 version File versions  Download package

QVariant QSqlDriver::handle (  )  const [virtual, inherited]

Returns the low-level database handle wrapped in a QVariant or an invalid variant if there is no handle.

Warning:
Use this with uttermost care and only if you know what you're doing.

The handle returned here can become a stale pointer if the connection is modified (for example, if you close the connection).

The handle can be NULL if the connection is not open yet.

The handle returned here is database-dependent, you should query the type name of the variant before accessing it.

This example retrieves the handle for a connection to sqlite:

doc/src/snippets/code/src_sql_kernel_qsqldriver.cpp 0

This snippet returns the handle for PostgreSQL or MySQL:

doc/src/snippets/code/src_sql_kernel_qsqldriver.cpp 1

See also:
QSqlResult::handle()

Definition at line 611 of file qsqldriver.cpp.

{
    return QVariant();
}


Generated by  Doxygen 1.6.0   Back to index