InterBase Express (IBX) is a set of data access components that provide a means of accessing data from InterBase databases. The InterBase Administration Components, which require InterBase 6, are described after the InterBase data access components.
The following components are located on the InterBase tab of the component palette.
Icon |
Component Name |
Description |
|
TIBTable |
A dataset component that encapsulates a database table. |
|
TIBQuery |
Executes an InterBase SQL statement. |
|
TIBStoredProc |
Encapsulates a stored procedure on a database server. |
|
TIBDatabase |
Encapsulates an InterBase database connection. |
|
TIBTransaction |
Provides discrete transaction control over a one or more database connections in a database application. |
|
TIBUpdateSQL |
Provides an object for updating read-only datasets when cached updates are enabled. |
|
TIBDataSet |
Executes InterBase SQL statements. |
|
TIBSQL |
Provides an object for executing an InterBase SQL statement with minimal overhead. |
|
TIBDatabaseInfo |
Returns information about the attached database. |
|
TIBSQLMonitor |
Monitors dynamic SQL passed to the InterBase server. |
|
TIBExtract |
Fetches metadata from an InterBase server. |
|
TIBCustomDataSet |
The base class for all datasets that represent data fetched using InterBase Express. |
Though they are similar to BDE components in name, the IBX components are somewhat different. For each component with a BDE counterpart, the sections below give a discussion of these differences.
There is no simple migration from BDE to IBX applications. Generally, you must replace BDE components with the comparable IBX components, and then recompile your applications. However, the speed you gain, along with the access you get to the powerful InterBase features make migration well worth your time.
IBDatabase
Use a TIBDatabase component to establish connections to databases, which can involve one or more concurrent transactions. Unlike BDE, IBX has a separate transaction component, which allows you to separate transactions and database connections.
To set up a database connection:
user_name=sysdba password=masterkey
IBTransaction
Unlike the Borland Database Engine, IBX controls transactions with a separate component, TIBTransaction. This powerful feature allows you to separate transactions and database connections, so you can take advantage of the InterBase two-phase commit functionality (transactions that span multiple connections) and multiple concurrent transactions using the same connection.
Use an IBTransaction component to handle transaction contexts, which might involve one or more database connections. In most cases, a simple one database/one transaction model will do.
To set up a transaction:
There are a variety of dataset components from which to choose with IBX, each having their own characteristics and task suitability:
IBTable
Use an TIBTable component to set up a live dataset on a table or view without having to enter any SQL statements.
IBTable components are easy to configure:
Use an TIBQuery component to execute any InterBase DSQL statement, restrict your result set to only particular columns and rows, use aggregate functions, and join multiple tables.
IBQuery components provide a read-only dataset, and adapt well to the InterBase client/server environment. To set up an IBQuery component:
Use an TIBDataSet component to execute any InterBase DSQL statement, restrict your result set to only particular columns and rows, use aggregate functions, and join multiple tables. IBDataSet components are similar to IBQuery components, except that they support live datasets without the need of an IBUpdateSQL component.
The following is an example that provides a live dataset for the COUNTRY table in employee.gdb:
Sample SQL statements
Property |
SQL Statement |
SelectSQL |
SELECT Country, Currency FROM Country |
RefreshSQL |
SELECT Country, Currency FROM Country WHERE Country = :Country |
ModifySQL |
UPDATE Country SET Country = :Country, Currency = :Currency WHERE Country = :Old_Country |
DeleteSQL |
DELETE FROM Country WHERE Country = :Old_Country |
InsertSQL |
INSERT INTO Country (Country, Currency) VALUES (:Country, :Currency) |
FieldByName(EmpNo)
would return nothing in dialect 3 if the field was 'EMPNO'.
IBStoredProc
Use TIBStoredProc for InterBase executable procedures: procedures that return, at most, one row of information. For stored procedures that return more than one row of data, or "Select" procedures, use either IBQuery or IBDataSet components.
IBSQL
Use an TIBSQL component for data operations that need to be fast and lightweight. Operations such as data definition and pumping data from one database to another are suitable for IBSQL components.
In the following example, an IBSQL component is used to return the next value from a generator:
SELECT GEN_ID(MyGenerator, 1) FROM RDB$DATABASE
IBUpdateSQL
Use an TIBUpdateSQL component to update read-only datasets. You can update IBQuery output with an IBUpdateSQL component:
Use an TIBSQLMonitor component to develop diagnostic tools to monitor the communications between your application and the InterBase server. When the TraceFlags properties of an IBDatabase component are turned on, active IBSQLMonitor components can keep track of the connection's activity and send the output to a file or control.
A good example would be to create a separate application that has an IBSQLMonitor component and a Memo control. Run this secondary application, and on the primary application, activate the TraceFlags of the IBDatabase component. Interact with the primary application, and watch the second's memo control fill with data.
IBDatabaseInfo
Use an TIBDatabaseInfo component to retrieve information about a particular database, such as the sweep interval, ODS version, and the user names of those currently attached to this database.
For example, to set up an IBDatabaseInfo component that displays the users currently connected to the database:
Memo1.Text := IBDatabaseInfo.UserNames.Text; // Delphi example
Memo1->Text = IBDatabaseInfo->UserNames->Text; // C++ example
IBEvents
Use an IBEvents component to register interest in, and asynchronously handle, events posted by an InterBase server.
To set up an IBEvents component:
If you have InterBase 6 installed, you can use the InterBase 6 Administration components, which allow you to use access the powerful InterBase Services API calls.
The components are located on the InterBase Admin tab of the IDE and include:
|
TIBConfigService |
|
TIBBackupService |
|
TIBRestoreService |
|
TIBValidationService |
|
TIBStatisticalService |
|
TIBLogService |
|
TIBSecurityService |
|
TIBLicensingService |
|
TIBServerProperties |
|
TIBInstall |
|
TIBUnInstall |
Note: You must install InterBase 6 to use these features.
IBConfigService
Use an TIBConfigService object to configure database parameters, including page buffers, async mode, reserve space, and sweep interval.
IBBackupService
Use an TIBBackupService object to back up your database. With IBBackupService, you can set such parameters as the blocking factor, backup file name, and database backup options.
IBRestoreService
Use an TIBRestoreService object to restore your database. With IBRestoreService, you can set such options as page buffers, page size, and database restore options.
IBValidationService
Use an TIBValidationService object to validate your database and reconcile your database transactions. With the IBValidationService, you can set the default transaction action, return limbo transaction information, and set other database validation options.
IBStatisticalService
Use an TIBStatisticalService object to view database statistics, such as data pages, database log, header pages, index pages, and system relations.
IBLogService
Use an TIBLogService object to create a log file.
IBSecurityService
Use an TIBSecurityService object to manage user access to the InterBase server. With the IBSecurityService, you can create, delete, and modify user accounts, display all users, and set up work groups using SQL roles.
IBLicensingService
Use an TIBLicensingService component to add or remove InterBase software activation certificates.
IBServerProperties
Use an TIBServerProperties component to return database server information, including configuration parameters, and version and license information.
IBInstall
Use an TIBInstall component to set up an InterBase installation component, including the installation source and destination directories, and the components to be installed.
IBUnInstall
Use an TIBUnInstall component to set up an uninstall component.
Copyright(C) 2008 CodeGear(TM). All Rights Reserved.
|
What do you think about this topic? Send feedback!
|