UniDAC

Using NexusDB data access provider with UniDAC in Delphi

This article provides a brief overview of the NexusDB data access provider for UniDAC used to establish a connection to NexusDB databases from Delphi and Lazarus. You will find the description of some useful features and how to get started quickly.

Overview

The main features of the NexusDB data access provider are:

Both Professional and Standard Editions of UniDAC include the NexusDB provider. Express Edition of UniDAC does not include the NexusDB provider.
NexusDB provider is supplied with source code.

Compatibility

To learn about NexusDB compatibility, refer to the Compatibility section.

Requirements

You should have installed NexusDB components for corresponding IDE. NexusDB provider uses the following NexusDB libraries: NexusDBXXXdbXX, NexusDBXXXsdXX, NexusDBXXXllXX, NexusDBXXXsrXX, NexusDBXXXptXX, NexusDBXXXtwXX, NexusDBXXXsqXX, NexusDBXXXseXX, NexusDBXXXstXX, NexusDBXXXreXX.
Before using the NexusDB provider, you have to rebuild and reinstall its provider package. You can find the detailed steps describing the installation of the package in the UniDAC_Install_Dir\Source\NexusDBProvider\Readme.html file, where UniDAC_Install_Dir is a directory where you installed UniDAC.

Deployment

NexusDB provider applications can be built and deployed with or without run-time libraries. You do not need to deploy any files with NexusDB provider-based applications built without run-time packages. You can set your application to be built with run-time packages. In this case, you will need to deploy the nexusproviderXX.bpl file, and following NexusDB libraries: NexusDBXXXdbXX, NexusDBXXXsdXX, NexusDBXXXllXX, NexusDBXXXsrXX, NexusDBXXXptXX, NexusDBXXXtwXX, NexusDBXXXsqXX, NexusDBXXXseXX, NexusDBXXXstXX, NexusDBXXXreXX. For more information about deployment of the UniDAC-based applications, please, refer to the common Deployment topic.

NexusDB-specific options

Though UniDAC is components that provide unified interface to work with different database servers, it also lets you tune behaviour for each server individually. For thin setup of a certain database server, UniDAC provides server-specific options. These options can be applied to such components as TUniConnection, TUniQuery, TUniTable, TUniStoredProc, TUniSQL, TUniScript via their SpecificOptions property. SpecificOptions is a sting list. Therefore you can use the following syntax to assign an option value:
UniConnection.SpecificOptions.Values['FetchAll'] := 'True';
Below you will find the description of allowed options grouped by components.

UniQuery.SpecificOptions.Values['FieldsAsString'] := 'True';

Below you will find the description of allowed options grouped by components.

TUniConnection

Option name Description
CommandTimeout Specifies the elapsed time in seconds before an attempt to execute a command is considered unsuccessful. The default value is 15.
ConnectionTimeout Specifies the amount of time in seconds that can be expired before an attempt to make a connection is considered unsuccessful.
DatabaseReadOnly If True, no writing is required, allows for sharing databases between servers.
HeartbeatInterval Use the HeartbeatInterval option to specify how often the client will send a hearbeat message to the server. The default value is 10.
LostConnectionTimeout Specifies the amount of time in seconds that must expire before a connection is considered lost. The default value is 10.
WatchdogInterval Use the WatchdogInterval option to specify how often the client will check all connections. The default value is 10.

TUniSQL

Option name Description
CommandTimeout The time to wait for a statement to be executed.
ReadOnly Use the ReadOnly option to prevent users from modifying data in the database. The default value is False.

TUniQuery, TUniTable, TUniStoredProc

Option name Description
CommandTimeout The time to wait for a statement to be executed.
CursorUpdate Specifies what way data updates reflect on database when modifying dataset by using server NexusDB cursors (the ServerCursor option is set to True). If True, all dataset modifications pass to database by server cursors. It increases performance but doesn't allow to use procedures or enhanced queries for additional data changes. If False, all dataset updates pass to server by SQL statements generated automatically or specified in SQLUpdate, SQLInsert or SQLDelete. The default value is True.
FetchAll When set to True, all records of the query are requested from the database server when dataset is being opened. When set to False, records are retrieved when a data-aware component or a program requests it. If a query can return a lot of records, set this property to False if initial response time is important.
When the FetchAll property is False, the first call to Locate and LocateEx methods may take a lot of time to retrieve additional records to the client side.
ReadOnly Use the ReadOnly option to prevent users from updating, inserting, or deleting data in the dataset. By default, ReadOnly is False, meaning that users can potentially alter data stored in the dataset. To guarantee that users cannot modify or add data to a dataset, set ReadOnly to True.
ServerCursor By default, ServerCursor is False, meaning that NexusDB provider reads data to the own memory when dataset is opened. NexusDB provider performs all database operations using SQL statements generated automatically or specified in SQLUpdate, SQLInsert or SQLDelete. If True, then NexusDB provider calls server NexusDB cursor for resultset record access and then reads data from it. So, stored data aren't duplicated that allows you to decrease memory charges. Data to the server can be written using server cursor or SQL queries in dependence of CursorUpdate option. So the TCustomDADataSet.FetchRows, FetchAll, CachedUpdates properties don't have any influence on such cursors and only the CursorUpdate option does.

TUniScript

The TUniScript component has no NexusDB-specific options.

TUniLoader

Option name Description
DirectLoad If True, all inserted data pass to database by server NexusDB cursors. If False, all inserted data pass to server by SQL statements. The default value is True.

TUniDump

The TUniDump component has no NexusDB-specific options.

© 1997-2020 Devart. All Rights Reserved. Request Support DAC Forum Provide Feedback