Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members  

KDB::Connection Class Reference

Manages the connection state to a SQL engine. More...

#include <connection.h>

Inheritance diagram for KDB::Connection:

KDB::Object KDB::QObject List of all members.

Public Methods

virtual ~Connection ()
bool open ()
 Connect to the host. More...

void close (bool destructive = true)
 Disconnects from the host. More...

bool isConnected ()
 Returns true if a successful connection has been established.

bool saveStatus ()
 Returns true if a the connection will be saved in config files.

void setSaveStatus (bool status)
 sets the save status for this connection. More...

void setUser (const QString &name)
 Sets the user for this connection. More...

QString user ()
 Returns the user for this connection.

QString plugin ()
 Returns the plugin name of this connection.

void setPassword (const QString &pwd, bool save = false)
 Sets the password for this connection. More...

QString password ()
 Returns the password for this connection.

QString host ()
 Returns the host name for this connection.

int port ()
 Returns the port number for this connection.

QString prettyPrint ()
 Returns a complete description of the connection.

DatabaseopenDatabase (const QString &name)
 Open a database by name.

DatabasefindDatabase (const QString &name)
 Return a database by name. More...

virtual DatabasecreateDatabase (const QString &name)
 Creates a new database in the current connection.

DatabaseList databases ()
 Return a list of all available databases.

DatabaseIterator begin ()
 Return an iterator that points to the first database.

void saveToConfig ( KConfigBase *config, int number = -1)
 saves this connection to the given config file, with an optional connection number. More...


Signals

void closing (Connection *)

Friends

class  DBEngine

Detailed Description

Manages the connection state to a SQL engine.

Basically stores all authentication tokens and opens/closes connection as needed.

It is also a collection of database objects, allowing

Author(s):
Alessandro Praduroux <pradu@thekompany.com> , Michael Koch <m_kock@bigfoot.de>
Version:
kdbcore 0.0.2


Constructor & Destructor Documentation

virtual ~Connection ( ) [virtual]
 


Member Function Documentation

DatabaseIterator begin ( )
 

Return an iterator that points to the first database.

void close ( bool destructive = true )
 

Disconnects from the host.

all databases are closed. unless destructive == false, the connection is deleted right after the call

void closing ( Connection * ) [signal]
 

Database * createDatabase ( const QString & name ) [virtual]
 

Creates a new database in the current connection.

DatabaseList databases ( )
 

Return a list of all available databases.

Database * findDatabase ( const QString & name )
 

Return a database by name.

If no database with this name exists it returns 0L.

QString host ( )
 

Returns the host name for this connection.

bool isConnected ( )
 

Returns true if a successful connection has been established.

bool open ( )
 

Connect to the host.

If username and password are missing, pops up a dialog to ask them. If the connection is open, nothing is actually done. Returns true if the connection has been succesfully opened, false otherwise.

Database * openDatabase ( const QString & name )
 

Open a database by name.

QString password ( )
 

Returns the password for this connection.

QString plugin ( )
 

Returns the plugin name of this connection.

int port ( )
 

Returns the port number for this connection.

QString prettyPrint ( )
 

Returns a complete description of the connection.

bool saveStatus ( )
 

Returns true if a the connection will be saved in config files.

void saveToConfig ( KConfigBase * config,
int number = -1 )
 

saves this connection to the given config file, with an optional connection number.

The config file must exists and must refer to the correct section.

void setPassword ( const QString & pwd,
bool save = false )
 

Sets the password for this connection.

The change will not take place until a disconnect/connect is made. Passing QString::null will force the connection to ask for the password next time open() is called.

void setSaveStatus ( bool status )
 

sets the save status for this connection.

If the save status is true, the connection will be saved in kdbrc

void setUser ( const QString & name )
 

Sets the user for this connection.

The change will not take place until a disconnect/connect is made.

QString user ( )
 

Returns the user for this connection.


Friends And Related Function Documentation

class DBEngine [friend]
 


The documentation for this class was generated from the following file:
Generated at Fri Sep 29 16:32:22 2000 for KDB by doxygen1.2.1 written by Dimitri van Heesch, © 1997-2000