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

KDB::Connector Class Reference

#include <connector.h>

List of all members.

Public Methods

 Connector ()
 Connector (const Connector& c)
virtual ~Connector ()
void setHost (const QString & host)
void setPort (int port)
void setUser (const QString & user)
void setPassword (const QString & pwd)
QString host () const
int port () const
QString user () const
QString password () const
bool isConnected () const
virtual void close ()
 closes the connection to the database backend.

virtual bool connect () = 0
 opens the connection to the database backend.

virtual QString protocol () const = 0
 return the protocol of the current connection ( e.g. More...

virtual QStringList databases () = 0
 returns the list of the available databases for the current open connection.

virtual QStringList tables () = 0
 returns the list of the available tables for the current open database.

virtual QStringList queries () = 0
 returns the list of the available queries for the current open database.

virtual QStringList fields (const QString & tableName) = 0
 returns the list of the fields for the given table for the current open database.

virtual unsigned long long execute (const QString &sql) = 0
 executes an SQL statement. More...

virtual bool createDatabase (const QString & name) = 0
 creates an empty database.

virtual bool createTable (const Table & tab) = 0
 creates a table with the characteristic of the given one.

virtual Connector* clone () = 0
 clones the current object. More...

virtual bool setCurrentDatabase (const QString &name) = 0
 set the operational database for the current connector. More...

virtual DataType nativeToKDB (const QString &type) = 0
 returns the corresponding KDB datatype for the given native one.

virtual QString KDBToNative (DataType type) = 0
 returns the corresponding native datatype for the given KDB one.

virtual Handlerquery (const QString &SQL) = 0
 executes a select to the backend and returns an handler to the result.


Protected Methods

void setConnected (bool conn)
 must be called by subclasses when a connection to the backend is established.


Constructor & Destructor Documentation

Connector ( )
 

Connector ( const Connector & c )
 

virtual ~Connector ( ) [virtual]
 


Member Function Documentation

QString KDBToNative ( DataType type ) [pure virtual]
 

returns the corresponding native datatype for the given KDB one.

Connector * clone ( ) [pure virtual]
 

clones the current object.

If the object holds an open connection, the resulting connector must be open too.

void close ( ) [virtual]
 

closes the connection to the database backend.

bool connect ( ) [pure virtual]
 

opens the connection to the database backend.

bool createDatabase ( const QString & name ) [pure virtual]
 

creates an empty database.

bool createTable ( const Table & tab ) [pure virtual]
 

creates a table with the characteristic of the given one.

QStringList databases ( ) [pure virtual]
 

returns the list of the available databases for the current open connection.

unsigned long long execute ( const QString & sql ) [pure virtual]
 

executes an SQL statement.

The return value is the number of rows affected by the statement

QStringList fields ( const QString & tableName ) [pure virtual]
 

returns the list of the fields for the given table for the current open database.

QString host ( ) const
 

bool isConnected ( ) const
 

DataType nativeToKDB ( const QString & type ) [pure virtual]
 

returns the corresponding KDB datatype for the given native one.

QString password ( ) const
 

int port ( ) const
 

QString protocol ( ) const [pure virtual]
 

return the protocol of the current connection ( e.g.

"postgres","mysql")

QStringList queries ( ) [pure virtual]
 

returns the list of the available queries for the current open database.

Handler * query ( const QString & SQL ) [pure virtual]
 

executes a select to the backend and returns an handler to the result.

void setConnected ( bool conn ) [protected]
 

must be called by subclasses when a connection to the backend is established.

bool setCurrentDatabase ( const QString & name ) [pure virtual]
 

set the operational database for the current connector.

From this point all the methods will affect the selected database

void setHost ( const QString & host )
 

void setPassword ( const QString & pwd )
 

void setPort ( int port )
 

void setUser ( const QString & user )
 

QStringList tables ( ) [pure virtual]
 

returns the list of the available tables for the current open database.

QString user ( ) const
 


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