Delphi InterBase is a well-known SQL database for developers who want to embed a lightweight database management system into their cross-platform applications. Its popularity comes from its high performance, fast data processing, and seamless integration with Delphi, offering a hassle-free setup without the administrative overhead of other systems.
Now, the whole process is even easier if you use the right tools. In this article, we’ll walk you through everything you need to know about Delphi InterBase, including the step-by-step integration process. To help you get your projects up and running faster, we’ll use InterBase Data Access Components (IBDAC) for the integration.
It’s a comprehensive library that connects your IBDAC-based apps straight to the InterBase server via the native client —no need for extra layers and data access solutions.
Table of contents
- Key features of InterBase
- Editions and licensing options
- Getting started with InterBase 2020
- Using InterBase with Delphi
- Conclusion
Key features of InterBase
InterBase is built on the following elements:
- Native SQL capabilities: InterBase supports SQL standards, including complex joins and Unicode, along with advanced features like stored procedures and triggers.
- High database performance: Its multigenerational architecture allows multiple users to access data simultaneously without locking, which is crucial for high-traffic applications.
- Fast speed: InterBase uses modern multicore CPUs for quick data access and updates while maintaining a small footprint, with an option to run entirely in memory.
- Flexible data accessibility: It allows cross-platform deployment with a consistent on-disk format, plus offline capabilities and easy synchronization.
- Admin-free management: It handles thousands of transactions per second without constant backups, featuring quick crash recovery and incremental backups for data safety.
- Robust security: It provides AES 256-bit encryption for data in transit and at rest, along with a separate security login system for easy user access control.
- Reliable disaster recovery: It lets you perform live backups without interrupting users, allowing quick data dumps and multithreaded restores to ensure swift recovery from failures.
- Efficient replication: InterBase’s Change Views feature allows you to track changes at the field level easily, creating subscriptions for specific tables and columns to ensure secure updates.
Editions and licensing options
InterBase offers four editions to choose from. Take a look at the table below to see the pricing and licensing options available:
InterBase Edition | Pricing | Licensing |
---|---|---|
Developer | Free | Up to 20 users and 8 CPUs. |
IBLite | Free | 1 user with a maximum of 1 CPU. |
IBToGo | $64 per new user; $32 per upgrade user. | 1 user and up to 4 CPUs. |
Desktop | $64 per new user; $32 per upgrade user. | 1 user and up to 4 CPUs; limited to local database connections. |
Server | Custom | Depends on purchase, up to 32 CPUs. |
Getting started with InterBase 2020
InterBase 2020 doesn’t require extensive configurations. If you choose the Desktop or Server editions, the installation process is typically a simple wizard-driven setup. You can also integrate them into your custom installer. Things are even easier if you go for the ToGo or IBLite editions — you just have to link to the InterBase libraries.
Installation requirements
Before going full in, double-check the installation requirements for your InterBase edition. While all versions come with RAD Studio support, there are some differences in terms of what operating systems and hardware they work with.
InterBase Developer, Desktop and Server Edition
- A Windows (from 2008 to 11) or Linux (RHEL 8, SuSE 11.3, or Ubuntu 18 or 20) system with an Intel x86/x86-64 processor
- About 250MB of free space on your hard disk
InterBase ToGo Edition
- Works on the same Windows and Linux versions, plus macOS (10.15 to 12), Android (8 to 13), and iOS (14 to 17)
- If you’re using a Java-based app, install the Java Runtime Environment (JRE) library
To learn more about the specific installation requirements for your edition, check Embarcadero’s InterBase documentation.
Installation
Follow the steps below to install InterBase through their installer:
- Download your InterBase’s edition from the official site. Keep your serial number and Embarcadero Developer Network username and password for later.
- Double-click on install_windows.exe (Windows) or ib_install.exe (macOS).
- Click on Install InterBase 2020 once the installer launches. In Unix, you must first provide your Administrator password.
- Follow the on-screen instructions. In the Choose Install Set panel, select whether you want a Server and Client or Client only install.
- Then, you’ll be asked if you want to set up multiple instances. Choose Yes or No and click Next.
- In the next panel, you can either change the installation location or keep the default.
- After that, review your choices in the Pre-Installation Summary. If everything looks good, click Install.
- Once the installation is complete, the InterBase License Registration window pops up. Add your serial number, username, and password, then click Finish.
If you want to do a silent install or need help with troubleshooting any issues that come up during the process, read InterBase’s Installation guide.
Using InterBase with Delphi
Delphi integration with InterBase can be clunky if you use dbExpress, BDE, or InterBase Express. These usually complicate your setup with additional data access layers and software. In contrast, IBDAC connects directly to the InterBase server through the client software, which simplifies deployment and allows you to write more streamlined applications.
It supports the full range of InterBase features and comes with optimized data access, so you can create apps with faster connection reopening, better query execution, and smooth updates. If your project uses BDE or IBX, you can migrate using the Migration Wizard and automate the process to save time.
Other key features include integration with RAD Studio and Delphi 6+ among other IDEs, offline capabilities, automatic data updates, and support for building client/server applications using Delphi or C++Builder Professional. Plus, IBDAC has extensive documentation, quick technical support, and plenty of demo projects to help you get started.
Integrating InterBase in Delphi applications
With IBDAC’s built-in Delphi support and easy database integration, you can speed up application development and connect your project to InterBase in minutes.
Here’s an overview of the process:
Requirements
First, you need to install IBDAC. Simply download the version compatible with your Delphi IDE, run the installer, and follow the prompts. Also, make sure the InterBase server is running and you know the server address, port, database file path, username, and password. You’ll need these to create a connection.
Create a connection
Now, use the server’s details to set up the TIBCConnection component or define the parameters in the ConnectString property.
Once you’ve set them up, you can choose to connect either at design-time or runtime. At design-time, you can visually configure the TIBCConnection component in the Delphi IDE using either the TIBCConnection Editor or Object Inspector.
If you opt for runtime connections, you’ll programmatically set these properties in your code before calling the Open method to establish the connection.
Open a connection
After configuring the connection, the next step is to open it so you can start interacting with the database. You have a couple of options for this: you can either set the Connected property to True in the Object Inspector at design-time, or you can do it in your code at runtime. You can also simply use the Open method in your code
Insert data
Let’s say you have a products table defined as follows:
ProductID | ProductName | Category | Price |
---|---|---|---|
1 | Bluetooth Speaker | Electronics | 49.99 |
2 | Coffee Maker | Appliances | 89.99 |
3 | Yoga Mat | Fitness | 19.99 |
If you want to add a new product at design-time, you can write your own SQL statement and execute it using the TIBCQuery.
Just add the TIBCQuery object to your form. If this is your first one, it’ll automatically be named IBCQuery1. Double-clicking on it opens the SQL editor, where you can write:
INSERT INTO products VALUES (4, 'Electric Kettle', 'Appliances', 39.99);
If you prefer to insert data at runtime, use the Insert, Append, and Post methods from TIBCQuery and TIBCTable components. Below we’ve used the Append method:
var
IBCQuery1: TIBCQuery;
begin
IBCQuery1 := TIBCQuery.Create(nil);
try
IBCQuery1.Connection := IBCConnection1;
IBCQuery1.SQL.Text := 'SELECT * FROM products';
IBCQuery1.Open;
IBCQuery1.Append;
IBCQuery1.FieldByName('ProductID').AsInteger := 4;
IBCQuery1.FieldByName('ProductName').AsString := 'Electric Kettle';
IBCQuery1.FieldByName('Category').AsString := 'Appliances';
IBCQuery1.FieldByName('Price').AsFloat := 39.99;
IBCQuery1.Post;
finally
IBCQuery1.Free;
end;
end;
Retrieve Data
If you need to retrieve data from a table, the TIBCQuery and TIBCTable components are also your go-to. For example, to fetch all the records from the products table using TIBCQuery, write:
IBCQuery1.Connection := IBCConnection1;
IBCQuery1.SQL.Text := 'SELECT * FROM products';
IBCQuery1.Open;
ShowMessage(IntToStr(IBCQuery1.RecordCount));
Modify Data
Now, suppose you want to update a product from the table. You can either write a DML statement like:
IBCQuery1.SQL.Add('UPDATE products SET ProductName = :ProductName, Price = :Price WHERE ProductID = :ProductID;');
IBCQuery1.ParamByName('ProductID').AsInteger := 4;
IBCQuery1.ParamByName('ProductName').AsString := 'Toaster';
IBCQuery1.ParamByName('Price').AsFloat := 34.55;
IBCQuery1.Execute;
Or use the Edit and Post methods of the TIBCQuery and TIBCTable components to skip writing SQL:
IBCQuery1.FindKey([4]);
IBCQuery1.Edit;
IBCQuery1.FieldByName('ProductName').AsString := 'Toaster';
IBCQuery1.FieldByName('Price').AsFloat := 34.55;
IBCQuery1.Post;
Check IBDAC’s comprehensive documentation to learn other use cases and getdetailed guidance on its functionalities.
Conclusion
InterBase provides all the essentials to develop Delphi applications with an embedded database that scales and runs across multiple platforms without hogging your system resources. IBDAC simplifies database integration giving you direct access to InterBase servers, which lets you create flexible applications faster. Try IBDAC for free to skip the headaches of complex configurations and cumbersome Delphi InterBase integrations.