kexi

Kross::KexiDB::KexiDBConnection Class Reference

#include <kexidbconnection.h>

Public Member Functions

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

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.

Constructor & Destructor Documentation

◆ KexiDBConnection()

KexiDBConnection::KexiDBConnection ( ::KexiDB::Connection * connection,
KexiDBDriver * driver = 0,
KexiDBConnectionData * connectiondata = 0 )

Definition at line 38 of file kexidbconnection.cpp.

◆ ~KexiDBConnection()

KexiDBConnection::~KexiDBConnection ( )
virtual

Definition at line 94 of file kexidbconnection.cpp.

Member Function Documentation

◆ getClassName()

const TQString KexiDBConnection::getClassName ( ) const
virtual

Definition at line 97 of file kexidbconnection.cpp.


The documentation for this class was generated from the following files: