|
|
This class allows you to handle the database drivers. You can get a new connection to a database with new_connection.
hk_drivermanager (void)
| hk_drivermanager |
Parameters:
runtime | if true the user has no possibility to change table and form structures or query statements |
hk_drivermanager (bool runtime)
| hk_drivermanager |
~hk_drivermanager (void)
| ~hk_drivermanager |
hk_connection* new_connection (const hk_string& drivername="",enum_interaction i=interactive)
| new_connection |
with this method you can create a new connection to a database. If no driver is set a dialog appears which asks for the driver. You can set a GUI dependend driverdialog with set_driverselectdialog.
Parameters:
drivername | name of the wished database driver (i.e. mysql) |
i | if i is set to 'interactive' warningmessages and dialog boxes will be shown |
Returns: a driver specific version of hk_connection or NULL if no driver could be found.
hk_connection* find_existing_connection (const hk_string& drivername,const hk_string& host,unsigned int tcp_port,const hk_string& user)
| find_existing_connection |
If an already created connection exists, it will be returned otherwise NULL
vector<hk_string>* driverlist (void)
| driverlist |
[static]
void set_path (const hk_string& path)
| set_path |
[static]
Path to the directory where the database drivers are stored.(default: /usr/local/hk_classes/drivers)
hk_string path (void)
| path |
[static]
void set_driverselectdialog (requestdialogtype* dialog)
| set_driverselectdialog |
[static]
you can write your own GUI dependend function to show a driver select dialog by defining a function of requestdialogtype
hk_string show_driverselectdialog (void)
| show_driverselectdialog |
[static]