# class DBEngine | Entry point for the library. More...
Full name | `KDB::DBEngine`
Definition | `#include <dbengine.h>`
Inherits | KDB::Object [public ]
List of all Methods
Annotated List
Files
Globals
Hierarchy
Index

#### Public Methods

- virtual ~DBEngine ()
- PluginIterator beginPlugins ()
- Plugin * findPlugin (const QString &name)
- QStringList pluginNames ()
- Connection * openConnection (const QString &pluginName, const QString &host, int port, const QString &user, const QString &password = QString::null)
- Connection * openConnection (const QString &name)
- virtual Connection * addConnection (const QString &pluginName, const QString &host, int port = 0, const QString &user = QString::null, const QString &password = QString::null)
- void remove (Connection *)
- Connection * findConnection (const QString &plugin, const QString &host, const int port, const QString &user)
- Connection * findConnection (const QString &name)
- ConnectionIterator beginConnections ()
- void loadConnections (KConfigBase *config = 0L)
- void saveConnections (KConfigBase *config = 0L)
- Database * openDatabase (const QString &pluginName, const QString &host, int port, const QString &user, const QString &password, const QString &databaseName)
- KConfigBase * config ()
- void setConfig (KConfigBase* config)

#### Signals

- void connectionAdded (KDB::Connection *)
- void connectionRemoved (KDB::Connection *)

#### Public Static Methods

- static DBEngine * self ()

#### Protected Methods

- bool loadPlugin (const QString&)

#### Protected Slots

- void slotConnectionClosed (KDB::Connection *)

## Detailed Description

Entry point for the library.

This object manages all available plugins, and can create connections to servers or databases.

In more detail:

- On first reference, loads all plugins registered in $KDEDIR/share/services.
- Allows iterations through all available plugins.
- Provide functions to directly access connections and databases through openDatabase and openConnection

~DBEngine () | ### ~DBEngine

[virtual]

DBEngine * self () | ### self

[static]

creates, if needed, the engine object, and returns it

PluginIterator beginPlugins () | ### beginPlugins

Returns an iterator that points to the first plugin.

Plugin * findPlugin (const QString &name) | ### findPlugin

Find a plugin by name. If no plugin is found, OL is returned.

QStringList pluginNames () | ### pluginNames

Returns the names of all detected plugins

Connection * openConnection (const QString &pluginName, const QString &host, int port, const QString &user, const QString &password = QString::null) | ### openConnection

Open a connection to the given host, with the given plugin, username and password. If the plugin does not exists, OL is returned. This is a convenience function, to avoid passing through a plugin to get a connection

Connection * openConnection (const QString &name) | ### openConnection

open a connection by name. If there is no such connection, 0L is returned. This differs from the other openConnection call, that builds one on the fly

Connection * addConnection (const QString &pluginName, const QString &host, int port = 0, const QString &user = QString::null, const QString &password = QString::null) | ### addConnection

[virtual]

Creates a connection object, without acually opening it

void remove (Connection *) | ### remove

Removes a connection from the list of connections. This will delete the connection, so make sure to not have dangling reference to the connection.

Connection * findConnection (const QString &plugin, const QString &host, const int port, const QString &user) | ### findConnection

Return a connection to the specified host for the given user. If the returned value is 0L no connection with the specified arguments is found.

Connection * findConnection (const QString &name) | ### findConnection

return a connection with the specified name

ConnectionIterator beginConnections () | ### beginConnections

Returns an iterator that points to the first Connection object.

void loadConnections (KConfigBase *config = 0L) | ### loadConnections

Load all connections saved in the KConfig-object config. If config is 0L the connections will be load from the standard file kdbrc.

void saveConnections (KConfigBase *config = 0L) | ### saveConnections

Save all connections to the KConfig-object config. If config is 0L the connections will be saved into the standard file kdbrc.

Database * openDatabase (const QString &pluginName, const QString &host, int port, const QString &user, const QString &password, const QString &databaseName) | ### openDatabase

Open a database. This is a convenience function.

KConfigBase * config () | ### config

retrieves the engine config object. this is either the general kde-db config file kdbrc or a user supplied one, set using setConfig()

void setConfig (KConfigBase* config) | ### setConfig

sets the config file for the current session. any unsaved change to the previous config file will be lost

void connectionAdded (KDB::Connection *) | ### connectionAdded

[signal]

void connectionRemoved (KDB::Connection *) | ### connectionRemoved

[signal]

bool loadPlugin (const QString&) | ### loadPlugin

[protected]

Loads a plugin by its name if it is not already loaded.

void slotConnectionClosed (KDB::Connection *) | ### slotConnectionClosed

[protected slots slot]

- Version: kdbcore 0.0.2
- Author: Alessandro Praduroux <pradu@thekompany.com>
- Generated: root@i386.ports.openbsd.org on Wed Apr 25 13:59:09 2001, using kdoc 2.0a53.