The Connector component
In order for your application to use the database for object storage, you must use a connector component. The connector acts as a gateway between your application and the database (by means of an internal component called the broker) and manages all the objects that are stored to and retrieved from the database. A connector component for each type of data access layer that has been installed from InstantObjects is available on the component palette. A connector is attached to a database by assigning a connection component to its Connection (or equivalent) property. Each connector component supports its own connection type.
Available Connectors and Brokers
InstantObjects supports a variety of databases and data-access technologies by means of packages called Brokers. You can build and install the broker(s) you need from the Brokers sub-folder of InstantObjects's Source folder.
SQL-based Brokers (Recommended)
SQL-based brokers offer better performance and additional features like external storage, optimized queries, and statement caching:
| Type | Connector | Connection | Description |
|---|---|---|---|
| FireDAC | TInstantFireDACConnector | TFDConnection | Universal data access layer supporting multiple databases (InterBase, Firebird, MS SQL Server, MySQL, Oracle, PostgreSQL, SQLite, and more). Available from Delphi XE5+. Recommended for new projects. |
| ADO | TInstantADOConnector | TADOConnection | MS Access (table-based) and MS SQL Server (SQL-based) through ADO/OLEDB. |
| IBX | TInstantIBXConnector | TIBDatabase | InterBase and Firebird using IBX components (included with Delphi). |
| DBX | TInstantDBXConnector | TSQLConnection | dbExpress support for multiple databases (InterBase, MS SQL Server, MySQL, Oracle, DB2). |
File-based and Lightweight Brokers
| Type | Connector | Connection | Description |
|---|---|---|---|
| XML | TInstantXMLConnector | TXMLFilesAccessor | Lightweight XML file-based storage. Each object is stored as a separate XML file. Ideal for small datasets and prototyping. |
| JSON | TInstantJSONConnector | TJSONFilesAccessor | Modern JSON file-based storage with optional Neon serialization support. Each object stored as JSON file. Excellent for REST integration and data interchange. See JSON Broker for details. |
Legacy Dataset-based Brokers
Dataset-based brokers use navigational access and have some limitations compared to SQL-based brokers:
| Type | Connector | Connection | Description |
|---|---|---|---|
| BDE | TInstantBDEConnector | TDatabase | Borland Database Engine. Legacy technology, not recommended for new projects. |
Catalog Dependencies
Some SQL brokers require separate catalog packages for database-specific type mapping:
| Broker | Required Catalog(s) |
|---|---|
| IBX | IBFb Catalog |
| DBX | IBFb, MSSql, MySQL Catalogs (depending on target database) |
| ADO | MSSql Catalog |
| FireDAC | IBFb, MSSql, MySQL Catalogs (depending on target database) |
Using Connectors
Drop an appropriate connector component and a matching connection component on a form or a data module in your project:
- Configure the connection component to access the database
- Assign the connection to the connector's
Connectionproperty - Set the connector's
IsDefaultproperty toTrueto make it the default for your application - Optionally configure broker-specific properties (e.g.,
UseUnicode,UseTransactions)
Connection Manager
You can also use a TInstantConnectionManager component that stores connection data in external files (.con or .xml format) and can create connectors and connections automatically based on this data. This is particularly useful when you don't want to hard code a particular broker or set of brokers into your program. The Connection Manager allows:
- Multiple connection profiles
- Runtime broker selection
- Database building and evolution tools
- Connection pooling and management
See the Primer Demo application for an example of this technique.
Choosing the Right Broker
For new projects:
- Use FireDAC for maximum flexibility and database support
- Use JSON for file-based storage, REST services, or data interchange
- Use IBX for InterBase/Firebird-only projects
For existing projects:
- Continue using your current broker unless you need features only available in SQL-based brokers
- Consider migrating to FireDAC for improved performance and features
