Introduction
UniDAC (Universal Data Access Component) is a powerfull library of nonvisual components developed by Devart, that provides direct access to multiple databases across many type of IDE on Windows, MAC OS X, iOS, Android, etc. UniDAC offers unified approach to the database-related applications development process like Oracle, MySQL, InterBase, Microsoft SQL Server, Firebird, Postgre SQL, etc.
The principal advantage of UniDAC technology is that it's easy to setup.
Detailed description
With UniDAC you can easily switch between different databases in your projects without delving into their specifications. It is very convenient in setup and use, providing independent interface server to work with different databases.
UniDAC consists essentialy of two elements: The first is its engine, which provides the developer a common, unified programming interface, receptive to the various supported databases. The second element can be considered its most important part, which is your data access layer itself. Here it is made by providers access to data, which will provide interaction between the engine and the various database servers supported. Each provider is then responsible for working with a specific database server (eg TOracleUniProvider for Oracle, TInterBaseUniProvider for Postgre SQL).
Main features
- Support the development of applications for Android;
- Support the development of applications for iOS
- Support NextGen compiler
- Development support for Mac OS X
- Development support for Win64
- Universal access to different databases
- Unicode support
- Independent database storage with TVirtualTable component
Installation process
The UniDAC installation process is as natural as any other Windows application, provided by a Wizard which involves the traditional steps "Next-Next-Finish". Thus, at this moment, no further notice is necessary.
Just as a way to illustrate the installation itself, Figure 1 shows the initial stage of the process of version 5.0.2 of UniDAC in TrialVersion for Delphi XE4.
The UniDAC is commercial product, however, as most commercial software, it provides an experimental free version, the TrialVersion, which allow unrestricted access to the product for a certain period, usually 30 days. In the case of UniDAC, this period is 60 days.
Using the code
To make examples of how to use, I gonna use MySQL database and Delphi language. We gonna use 2 components:
TUniConnection: allows to configure and manage the connection with the SGBD.
TUniQuery: allows to use SQL instructions to select, insert and update data in tables.
To configure the connection, lets change the properties like this:
UniConnection1.providerName := 'MySQL';
UniConnection1.port := 3306;
UniConnection1.loginPrompt := False;
UniConnection1.server := '192.168.0.5';
UniConnection1.username := 'admin';
UniConnection1.password := 'pass';
UniConnection1.database := 'example_unidac';
With the code above, the connection can be done sucessfully, from any type of application, including Android and iOS application. To activate connection, we set connected property to true:
UniConnection1.connected := True;
Well, here we finish the connection settings to make UniDAC works with MySQL. To use with another SGBD, the steps are the same, just adjusting the appropriate proprerties.
Now to use the query component, we must set the connection and the SQL statement:
UniQuery1.connection := UniConnection1;
UniQuery1.SQL.Text := 'SELECT * FROM cars';
In example, I'm using table named cars, just to show how to set the SQL statement. Doing that, query have to be activated to realize the select.
That' all! This is the initial tutorial to use UniDAC with any SGBD.
Points of Interest
To More Information, See the Page With https://www.devart.com/unidac Which Has All Support and Details of Component, in Addition to Several Other Interesting Components to Facilitate Your Development.