|
|
This is the base class for the interaction between kdbcore and the various plugins. It should be subclassed by plugins, but should not be used by the client programs
Connector ()
| Connector |
Connector (const Connector& c)
| Connector |
~Connector ()
| ~Connector |
[virtual]
void close ()
| close |
[virtual]
closes the connection to the database backend
bool connect ()
| connect |
[pure virtual]
opens the connection to the database backend
Reimplemented from QObject.
QStringList databases ()
| databases |
[pure virtual]
returns the list of the available databases for the current open connection
QStringList tables ()
| tables |
[pure virtual]
returns the list of the available tables for the current open database
RowList fields (const QString & tableName)
| fields |
[pure virtual]
returns the list of the fields for the given table for the current open database. The rows must contain:
the only mandatory fields are field name, datatype and size. All other values can be present if the DBMS is able to give them
KDB_ULONG execute (const QString &sql)
| execute |
[pure virtual]
executes an SQL statement. The return value is the number of rows affected by the statement
bool createDatabase (const QString & name)
| createDatabase |
[pure virtual]
creates an empty database
bool dropDatabase (const QString & name)
| dropDatabase |
[pure virtual]
drops a database with all its content
bool createTable (const Table & tab)
| createTable |
[pure virtual]
creates a table with the characteristic of the given one
bool dropTable (const QString & name)
| dropTable |
[pure virtual]
remove a table in the currend database deleting all its content
bool appendField (const QString &table, Field *f)
| appendField |
[pure virtual]
append a file to a table. the underlying DBMS must issue an alter here
bool removeField (const QString &table, const QString &field)
| removeField |
[pure virtual]
remove a field from a table. the underlying DBMS must issue an alter here
bool changeField (const QString &table, Field *f)
| changeField |
[pure virtual]
change the definition of a field of the given table. the underlying DBMS must issue an alter here
Connector * clone ()
| clone |
[pure virtual]
clones the current object. If the object holds an open connection, the resulting connector must be open too.
bool setCurrentDatabase (const QString &name)
| setCurrentDatabase |
[pure virtual]
set the operational database for the current connector. From this point all the methods will affect the selected database
DataType nativeToKDB (const QString &type)
| nativeToKDB |
[pure virtual]
returns the corresponding KDB datatype for the given native one
QString KDBToNative (DataType type)
| KDBToNative |
[pure virtual]
returns the corresponding native datatype for the given KDB one
Handler * query (const QString &SQL)
| query |
[pure virtual]
executes a select to the backend and returns an handler to the result
Query * createQueryObject (QObject *parent = 0L,
const char *name = 0L,
const QString &sql = QString::null)
| createQueryObject |
[virtual]
Create a query object. Plugins can override some functions of the class Query to take advantage of some specific optimizations. This is entirely optional, default implementations with a meaningful behaviour are provided in the kdedb core library
void beginTransaction ()
| beginTransaction |
[pure virtual]
start a transaction for the current connection an error is raised if the underlying DBMS does not support transactions
void commit ()
| commit |
[pure virtual]
end the current transaction and save all the changes to the database. an error is raised if the underlying DBMS does not support transactions or if there isn't any transaction started
void rollback ()
| rollback |
[pure virtual]
end the current transaction and drop all changes made up to now. an error is raised if the underlying DBMS does not support transactions or if there isn't any transaction started
void setHost (const QString & host)
| setHost |
void setPort (int port)
| setPort |
void setUser (const QString & user)
| setUser |
void setPassword (const QString & pwd)
| setPassword |
QString host ()
| host |
[const]
int port ()
| port |
[const]
QString user ()
| user |
[const]
QString password ()
| password |
[const]
bool isConnected ()
| isConnected |
[const]
void setConnected (bool conn)
| setConnected |
[protected]
must be called by subclasses when a connection to the backend is established