Skip to main content

Getting Started with DB2Rest

Let's discover DB2Rest in less than 10 minutes by running the Jar distribution.

Run On Premise / On Virtual Machines (VM)

In order to deploy DB2Rest on a laptop/PC/Mac, bare metal box or a VM on any cloud like Amazon EC2 or DigitalOcean Droplet, follow the steps below:

Minimum System Requirements

  • Java 21
  • 2-4 GB RAM/Memory.

DB2Rest needs Java Runtime 21+ to run. This is because it is compiled with Java 21 and makes uses of Java Virtual Thread feature for high scalability. Hence, DB2Rest can handling very high volume of requests even on a single node.

Install JDK 21+

Download JDK 21 or above. There are many flavors of JDK available from different vendors like Oracle, AWS, OpenJDK.

Open JDK can be downloaded from here - https://jdk.java.net/21/. This article from https://www.theserverside.com/blog/Coffee-Talk-Java-News-Stories-and-Opinions/How-to-install-Java-21 provides a step by step guide to install OpenJDK 21 on Windows platform.

Oracle JDK 21 can be downloaded and installed for various operating systems by following the instructions here

Download DB2Rest

Now that you have successfully downloaded, installed and verified Java 21, the next step is to get DB2Rest. DB2Rest is shipped as a single executable Java Archive or jar file So it's super easy to get up and running under a minute.

The latest version of DB2Rest - V-0.3.1-FIXED can be downloaded from the link below:

Download Link

https://download.db2rest.com/db2rest-0.3.1-FIXED.jar

Download Link for Legacy Oracle 9i

https://download.db2rest.com/db2rest-oracle9i-0.3.1-FIXED.jar

Run DB2Rest.

DB2Rest is just 60Mb and is immediately runnable. Fire up a terminal and execute the command below:

$ java -DDB_URL=[DB Url] -DDB_PASSWORD=[Password] -DDB_USER=[User] -jar db2rest-0.3.1-FIXED.jar

Replace the values for the following parameters:

Sl#Parameter NameDescriptionExample
1.DB URLJDBC URL connection string- MySQL : jdbc:mysql://localhost:3306/sakila
- PostgreSQL : jdbc:postgresql://localhost:5432/sakila?currentSchema=public
2.UserDatabase user
3.PasswordDatabase password

Once this command is executed, within a few seconds, DB2Rest is ready to service your data access requests.

Verify DB2Rest Installation

The actuator endpoint can be used to test the installation.


curl --request GET \
--url http://[IP_ADDRESS]:8080/actuator/health \
--header 'User-Agent: insomnia/8.6.1'


The actuator health check service in DB2Rest will return the following response:

HTTP/1.1 200
Content-Type: application/json
Transfer-Encoding: chunked

{
"status": "UP"
}