# How to access the Derby Database in CData Sync AMI Edition

**URL:** <https://community.cdata.com/t/how-to-access-the-derby-database-in-cdata-sync-ami-edition/1185>\
**Category:** Editions\
**Tags:** derby, article, cdata-sync, ami\
**Created:** [September 11, 2025, 9:05pm UTC](https://community.cdata.com/t/how-to-access-the-derby-database-in-cdata-sync-ami-edition/1185 "2025-09-11T21:05:18Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Harsh\_Paliwal](https://avatars.discourse-cdn.com/v4/letter/h/49beb7/32.png) [@Harsh\_Paliwal](https://community.cdata.com/u/Harsh_Paliwal)\
**Post date:** [September 11, 2025, 9:05pm UTC](https://community.cdata.com/t/how-to-access-the-derby-database-in-cdata-sync-ami-edition/1185/1 "2025-09-11T21:05:49Z")

</div>

In this article, we will demonstrate how to install the Derby database engine and how to connect to the Sync application database in the AMI edition.&nbsp;  
&nbsp;  
**Warning** : Modifying the application database directly may cause unexpected errors or data corruption if done incorrectly. Always back-up your database folder before making any changes, and if you need assistance, please contact [support@cdata.com](mailto:support@cdata.com)

**Start the instance and then access the CLI:**

1. Download Derby binary using the following command in the opt directory:

_wget [https://dlcdn.apache.org//db/derby/db-derby-10.17.1.0/db-derby-10.17.1.0-bin.tar.gz](https://dlcdn.apache.org//db/derby/db-derby-10.17.1.0/db-derby-10.17.1.0-bin.tar.gz)_

This will download the Apache Derby database engine (version 10.17.1.0).

2. Extract the archive:

_tar -xzf db-derby-10.17.1.0-bin.tar.gz_

Unpacks the Derby installation files.

 ![ac65fb26-c778-434c-aeef-d1f12e8e62f9.png](https://us1.discourse-cdn.com/cdata/original/1X/7b5f6b9ec4845e29fdecdd52f13ed356d7bcc9f1.png)

3. Create installation directory

_sudo mkdir /opt/ApacheDB_

Makes a directory `/opt/ApacheDB` to store the Derby binaries.

4. Move Derby into place

_sudo mv db-derby-10.17.1.0-bin /opt/ApacheDB_

Places Derby under `/opt/ApacheDB`.

 ![9acc148e-c726-40c7-9eb1-df1142b25400.png](https://us1.discourse-cdn.com/cdata/original/1X/8abc1cdca7377594db607d4a09bd5be337d3a445.png)

5. Set environment variable:

_export DERBY\_HOME=/opt/ApacheDB/db-derby-10.17.1.0-bin_

 ![55a532cc-0aa4-402d-ba2d-5e322c535d07.png](https://us1.discourse-cdn.com/cdata/original/2X/8/8ecde7f5d9f8f706dc8eec605bd082ffd11ed706.png)

Points the environment to where Derby is installed, so you can run Derby tools.

6. Launch Derby interactive SQL tool (ij)

_$DERBY\_HOME/bin/ij_

Starts Derby’s SQL shell (`ij`) to run SQL commands against a Derby database. The **ij** is a **command-line tool** that comes with **Apache Derby**.

**Note** : This version of Derby requires Java 19 or later. Please upgrade Java if you encounter an UnsupportedClassVersionError using the following command:

_sudo apt update_

_sudo apt install openjdk-21-jdk-headless -y_

7. Connect to CData Sync’s Derby DB

_connect ‘jdbc:derby:/opt/sync/db/cdata\_sync’;_

This will connect to the Derby database, allowing you to run queries against it.

 ![d515c158-4a78-4b6c-ad20-f291694d46ca.png](https://us1.discourse-cdn.com/cdata/original/2X/1/1dbe09a3dfba6ba962eb0fcd4c47c3c889a14920.png)

8. Example query:

_Select \* from sync\_job\_history;_

 ![1037558c-357e-4729-9f87-2a4456248f9d.png](https://us1.discourse-cdn.com/cdata/original/2X/3/34dc466bd1073993597881147c7dc69255ca85d3.png)
