AnyDAC
ContentsIndexHome
PreviousUpNext
Connect to Berkeley DB

Describes how to connect to Berkeley DB.

Group
Links
Supported versions

The AnyDAC SQLite native driver supports Berkeley DB version 5.1 and higher in SQL mode only. Read "Connect to SQLite database" chapter for more details. AnyDAC distinguishes SQLite and BDB DBMS brands and adjusts its own behavior to the connected database. 

 

Windows client software

AnyDAC requires the following x86 or x64 client software to be installed on the workstation:

  • the libdb_sql51.dll and libdb51.dll. The latest DLL version may be downloaded from here.

You can put the required files into one of the folders. Note, there must be no sqlite3.dll, otherwise AnyDAC will pickup this dll:

  • listed in your PATH environment variable (for example, <Windows>\SYSTEM32);
  • your application EXE folder;
  • any other folder and setup driver in AnyDAC\DB\ADDrivers.ini, then use BDB as driver ID for your connections:

 

[BDB]
BaseDriverID=SQLite
VendorLib=<folder>\libdb_sql51.dll

 

AnyDAC supports only dynamic linking of Berkeley DB x86 or x64 library. Note, by default SQLite driver is configured for static linking and Berkeley DB does not support static linking. To enable that:

  • open AnyDAC\Source\uAD.inc
  • locate there line:

 

    {$DEFINE AnyDAC_SQLITE_STATIC}  // Use SQLite3 static linking library

 

and replace it with: 

 

    {.$DEFINE AnyDAC_SQLITE_STATIC}  // Use SQLite3 static linking library

 

(dot between { and $)

 

Linux client software

AnyDAC on Linux supports only dynamic linking and requires:

  • the libdb_sql.so x86 or x64 engine.

 

Connection definition parameters

The parameters are the same as for SQLite

Notes:

  • Berkeley DB has different from SQLite encryption support and has only single encryption codec. Specification of encryption mode as part of password and Encrypt parameter are not supported.
  • Berkeley DB does not support BusyTimeout parameter, allowing to wait for a lock to be released. Instead Berkeley DB reports a deadlock error.
  • AnyDAC sets LockingMode=Exclusive by default. Set LockingMode=Normal for Berkeley DB.

 

Usage cases
  • Connect to a local database in normal mode, using driver configured in ADDrivers.ini:

 

DriverID=BDB
LockingMode=Normal
Database=$(ADHOME)\DB\Data\ADDemo.db
What do you think about this topic? Send feedback!