SQLdb Package

From Lazarus wiki
Revision as of 13:15, 12 July 2007 by Jsund (talk | contribs) (New page: The SQLdb package contains FPC units to access a number of SQL databases. It is "packaged" as sqldblaz.lpk in Lazarus. ==Components== The SQLdb package provides the following components: ...)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigationJump to search

The SQLdb package contains FPC units to access a number of SQL databases. It is "packaged" as sqldblaz.lpk in Lazarus.

Components

The SQLdb package provides the following components:

TSQLQuery

This is a descendant of TDataset, and provides the data as a table from the SQL query that you submit.

TSQLTransaction

This encapsulates the transaction on the database server. I am not going to say much about it as I haven't quite worked out the details myself! The important bit is that it has the commit and rollback methods to finish or cancel your transaction on the database.

TXXXConnection

where XXX is the flavour of the database you are connecting to. Each one of these components takes the "standard" requests of the SQLQuery and SQLTransaction components and translates them into database requests, allowing for the idiosyncrasies of the specific database you are using.

The actual components are:

  • TIBConnection (Borland Interbase / Firebird)
  • TODBCConnection (An ODBC connection to a database that the PC has the driver for ...)
  • TOracleConnection (Oracle)
  • TMySQL40Connection (MySQL - various versions)
  • TMySQL41Connection
  • TMySQL50Connection
  • TPQConnection (PostgreSQL)

(The pages related to the SQLdb package were initially written from explorations done using the TPQConnection, using a PostgreSQL 8.1 database. They are expected to be true for the other databases as well. If you can confirm this, please leave a note here.)