SqlWorker

Since: BlackBerry 10.0.0

#include <bb/data/SqlWorker>

To link against this class, add the following line to your .pro file: LIBS += -lbbdata

A worker that executes SQL commands in another thread.


Overview

Inheritance

bb::data::AsyncWorker
bb::data::SqlWorker

Public Functions Index

SqlWorker (const QString &dbPath, QObject *parent=0)
SqlWorker (const QString &dbPath, const QString &connectionName, QObject *parent=0)
virtual ~SqlWorker ()
virtual voidexecute (const QVariant &command, bb::data::DataAccessReply *replyData)
AsyncWorker (QObject *parent=0)Inherited

Public Functions

SqlWorker (

Constructs an SqlWorker object with the specified path to a database file and parent.

If the specified parent is not 0, the ownership of this object will be transferred to the parent.

Parameters
dbPath

The path to the SQL database. It is an absolute or relative file path to the local database. This path is also used as the connection name.

parent

The parent owner or 0. Optional and will default to 0 if not specified.

Since:

BlackBerry 10.0.0

SqlWorker (

Constructs an SqlWorker object with the specified path to a database file, connection name, and parent.

If the specified parent is not 0, the ownership of this object will be transferred to the parent.

Parameters
dbPath

The path to the SQL database. It is an absolute or relative file path to the local database.

connectionName

The name of the database connection.

parent

The parent owner or 0. Optional and will default to 0 if not specified.

Since:

BlackBerry 10.0.0

virtual~SqlWorker ()

Destructor.

Since:

BlackBerry 10.0.0

virtual void execute (

Executes the specified SQL command.

Internally, an instance of SqlDataAccess is used to execute SQL commands and, for queries, to return the results in the replyData parameter.

Parameters
command

The SQL string to be executed (other than transaction-related commands, which are not strings).

replyData

A previously created DataAccessReply with the ID value populated from the original call.

Since:

BlackBerry 10.0.0

AsyncWorker (Inherited

Constructs a worker that will perform asynchronous work.

Ownership will be managed by the async framework. The object ownership will be transferred to an internal object within this framework.

Parameters
parent

The parent owner. Do not specify as ownership will be overridden.

Since:

BlackBerry 10.0.0

Last modified: 2014-03-13

comments powered by Disqus