class Database

Central access point to all functionality of the single database. More...

Contains pure virtuals
Full nameKDB::Database
Definition#include <database.h>
InheritsKDB::Object
List of all Methods
Annotated List
Files
Globals
Hierarchy
Index

Public Methods

Protected Members


Detailed Description

Central access point to all functionality of the single database.

That means it provides a list of all queries and tables, and is able to execute a command query and to return a recordset for a given query.

Tables and queries can be accessed by name, and the class can provide collection objects for both.

 Database ( const char * name )

Database ()

[virtual]

TablePtr  newTable (const QString &name)

[pure virtual]

creates a new table for the current database. please note that the table is not yet part of the database until you call KDB::Table::create

TablePtr  getTable (const QString &name)

returns an existing table by name, or 0L if the table does not exists

Tables  tables ()

return the list of available tables

void  removeTable (const QString &name)

[pure virtual]

removes a table from the database. This means that the table is dropped, and all the content is erased

QueryPtr  newQuery (const QString &name, const QString &SQL)

[pure virtual]

creates a new query

Parameters:
namethis is the name of the query
SQLthis is the sql executed by the query. if it is not given, the query can be built with addTable, addField and so on

QueryPtr  getQuery (const QString &name)

returns an existing query by name, or 0L if the query does not exists

Queries  queries ()

return the list of available queries

void  removeQuery (const QString &name)

[pure virtual]

removes a query from the database.

RecordsetPtr  openRecordset (const QString &SQL)

[pure virtual]

creates a recordset based on a given query. if the query fails, 0L is returned. you can then check errorMessage() to get a specific error message

int  execute (const QString &SQL)

[pure virtual]

exec a command query. returns the number of records affected, or -1 if there is an error executing the query

void  open ()

[pure virtual]

void  close ()

[pure virtual]

bool  isOpen ()

Tables m_tables

[protected]

Queries m_queries

[protected]

bool m_open

[protected]

QString m_name

[protected]


Generated by: pradu@server.rete.casa on Fri Jul 28 15:15:55 2000, using kdoc 2.0a36.