sAlarm 0.5
Public Types | Public Member Functions
Database Class Reference

Database objects handles connection to database. More...

#include <database.h>

List of all members.

Public Types

enum  DriverTypes { SQLite, MySQL }
 Enumerates supported database backends. More...

Public Member Functions

 Database (QString connName="")
 Constructor.
 ~Database ()
 Destructor.
bool connect ()
 Connects the database.
QString connectionName () const
 Returns database connection name.
DriverTypes driverType () const
 Returns current driver type.
QSqlDatabase sqlDb ()
 Returns pointer to QSqlDatabase.

Detailed Description

Database objects handles connection to database.

Database class is used for establishing database connection.


Member Enumeration Documentation

Enumerates supported database backends.

DriverTypes provide enumeration of supported database drivers.

See also:
driverType()

Constructor & Destructor Documentation

Database::Database ( QString  connName = "")

Constructor.

Initializes the database. Recieves connection name as parameter.

Parameters:
connNamedatabase connection name
See also:
connectionName()

Member Function Documentation

bool Database::connect ( )

Connects the database.

Returns:
Returns true if connection was successful
QString Database::connectionName ( ) const [inline]

Returns database connection name.

Returns:
Returns the database connection name
DriverTypes Database::driverType ( ) const [inline]

Returns current driver type.

Returns:
Returns current database driver type
QSqlDatabase Database::sqlDb ( ) [inline]

Returns pointer to QSqlDatabase.

Returns:
Returns pointer to QSqlDatabase object

The documentation for this class was generated from the following files:
 All Classes Functions Enumerations