SQLdb Package/zh CN

From Lazarus wiki
Revision as of 10:38, 23 October 2011 by Lioncn (talk | contribs) (初稿)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigationJump to search

组件(Components)

SQLdb 包提供下列组件:

(原文:The SQLdb package provides the following components:)

TSQLQuery

继承自 TDataset, 功能是将提交的 SQL 查询执行后的结果数据集作为一张表中来使用。但也可以用来执行不返回任何数据集的SQL查询。

(原文:This is a descendant of TDataset, and provides the data as a table from the SQL query that you submit. But can also be used to execute SQL-queries that don't return any data.)

TSQLTransaction

封装了发生在数据库服务器上的事务。最重要的一点是,它使用 commit 或 rollback 方法来完成或取消数据库的事务。

(原文: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

XXX代表你所连接的数据库。每种组件都要配合 SQLQuery 组件和 SqlTransaction 组件一同使用,负责将 SQLQuery 发出的“标准”请求,转换成数据库请求,转换要符合所使用的特定数据库的专用语法格式。

实际包括的组件有:

  • TIBConnection (Borland Interbase / Firebird)
  • TODBCConnection (连接到有 ODBC 驱动程序的任何数据库...)
  • TOracleConnection (Oracle)
  • TMySQL40Connection (MySQL - 多个版本)
  • TMySQL41Connection
  • TMySQL50Connection
  • TMySQL51Connection (从 FPC 2.5.1起可用)
  • TPQConnection (PostgreSQL)
  • TSQLite3Connection (从 FPC 2.2.2起可用)

(原文: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
  • TMySQL51Connection (available since FPC version 2.5.1)
  • TPQConnection (PostgreSQL)
  • TSQLite3Connection (available since FPC version 2.2.2))