kexi

Kross::KexiDB::KexiDBConnection Class Reference

#include <kexidbconnection.h>

Inherits Kross::Api::Class< Kross::KexiDB::KexiDBConnection >.

List of all members.


Detailed Description

A connection to a database.

Example (in Python) ;

 # Import the kexidb module.
 import krosskexidb
 # Get the drivermanager.
 drivermanager = krosskexidb.DriverManager()
 # We need a connectiondata object.
 connectiondata = drivermanager.createConnectionData()
 # Fill the new connectiondata object with what we need to connect.
 connectiondata.setFileName("/home/user/kexisqlite3file.kexi")
 # Create the database-driver to access the SQLite3 backend.
 driver = drivermanager.driver("SQLite3")
 # Create the connection now.
 connection = driver.createConnection(connectiondata)
 # Establish the connection.
 if not connection.connect(): raise("Failed to connect with db")
 # Open database for usage. The filebased driver uses the filename as databasename.
 if not connection.useDatabase("/home/user/kexisqlite3file.kexi"): raise("Failed to use db")

Definition at line 68 of file kexidbconnection.h.


Public Member Functions

 KexiDBConnection (::KexiDB::Connection *connection, KexiDBDriver *driver=0, KexiDBConnectionData *connectiondata=0)
virtual const QString getClassName () const

The documentation for this class was generated from the following files:
KDE Home | KDE Accessibility Home | Description of Access Keys