Create, Deploy, and Run Java apps connecting to ATP on Azure (Eclipse)

August 26, 2019 | 5 minute read
Nirmala Sundarappa
Principal Product Manager
Text Size 100%:

Java developers are interested in connecting their Java  applications to Oracle Autonomous Transaction Processing (ATP) and Oracle Autonomous Data Warehousing (ADW) and take full advantage of autonomous database capabilities (self-patching, self-tuning, fully managed etc., ). The Java applications can be deployed either on Oracle Cloud or on Microsoft Azure.This blog provides specific instructions to create, deploy, and run the Java applications connecting to ATP with Tomcat on Microsoft Azure using Eclipse as the IDE. 

Let us get started with step by step instructions.


(1) Create ATP and Download client credentials:

  • Login to your oracle cloud at and create ATP in a few simple steps.
  • Download the client credentials file ( from "DB Connection" tab of ATP database that you created. Contents of the zip file are: tnsnames.ora,, sqlnet.ora, cwallet.ora, ewallet.p12, truststore.jks, keystore.jks
  • Make sure to check the version of the JDBC driver and JDK and other necessary steps by going through this section

(2) MS Azure Subscription: In order to deploy the Java web applications on Azure, you need to have signed up for MS Azure ( Note that this blog doesn't discuss or use Oracle's FastConnect

(3) Eclipse IDE: Make sure you have a working Eclipse IDE with the workspace setup. We have used 'Eclipse Java EE IDE for Web Developers'  in this blog

(4) Install MS Azure toolkit: With Eclipse IDE, install MS Azure Toolkit that will make it easier to deploy the Java web app on Azure. Follow these steps to Install and sign-in to complete your MS Azure Toolkit setup. 

Java webapp 

First, create a Java web application using Eclipse that connects to ATP. Deploy the web app on Azure using the MS Azure Toolkit and invoke the servlet and make sure it is working. Follow these three simple steps to get your web application working on Azure. 

Create a Java webapp for ATP
Deploy a Java webapp on Azure
Run a Java webapp 

Create a Java webapp for ATP

Step 1: Create a webapp: 
Click File --> New --> Dynamic Web Project. Choose the name of the webapp (e.g.,ATPWebApp) and click Finish.

Step 2: Download JDBC driver (ojdbc8.jar) and ucp.jar: 
Download the latest 19.3 ojdbc8-full.tar.gz that includes JDBC driver (ojdbc8.jar) and ucp.jar and add it under <eclipse-workspace>/ATPWebApp/WebContent/WEB-INF/lib. Note to use ojdbc8.jar that is comptible with JDK8. 

Note: When using JKS, remove oraclepki.jar, osdt_core.jar, and osdt_cert.jar from the classpath (lib folder).  These additional jars are required only for Oracle Wallets. 

Step 3: Unzip client credentials: 
Unzip the client credentials (wallet_<dbname>.zip) file to <eclipse-workspace>/ATPWebApp/WebContent/WEB-INF/lib

Java applications can use either JKS or Oracle Wallets to connect to the ATP database. The file is pre-configured for using Oracle Wallets. 

When using JKS, add the below properties in Note that the password used for these properties is the one used while downloading the client credentials zip file. 

JKS related property in
# Connection properties for using JKS. 
# Keystore and trustStore passwords are the password used while
# downloading the client credentials zip file from console.${TNS_ADMIN}/truststore.jks<password_from_console>${TNS_ADMIN}/keystore.jks<password_from_console>

Step 4: Create a context.xml:
Follow these instructions for creating a context.xml with ATP database details. Refer to the sample below. 
1. Place the context.xml under <eclipse-workspace>/ATPWebApp/WebContent/META-INF/context.xml
2. Update the database user and password to point to the ATP database that you have created.
3. Make sure the database URL has TNS alias. Check out tnsnames.ora or 'DB Connection' tab for the available services. 
4. TNS_ADMIN should be pointed to /home/site/wwwroot/webapps/ROOT/WEB-INF/lib, when you deploy it on the ROOT. If you have chosen a different slot then change the path accordingly. Use KUDU to check the location of the web app after the deployment. (E.g., http://<webappname> 

<Resource name="tomcat/UCP_atp" auth="Container"
   description="UCP Pool in Tomcat"

Step 5: Create the Servlet:
By default, a index.jsp is created. We can use that has the code to connect to the database and perform some database operations. Copy the servlet and place it under <eclipse-workspace>/ATPWebApp/src. You must use the datasource name used in context.xml in the UCPServlet. Example., we are using 'UCP_atp'  as the datasource. 

Deploy a Java web app on Azure

Step 1: Build the Java project
Right click on the project and make sure you are using JDK8 as the compiler and 'Build Project'. Make sure there are no compilation errors. 

Step 2: Deploy the Java webapp
Use Azure Tool Kit to deploy the web app on Azure as shown below. Make sure to login to your Azure account before the deployment. 

Create an AppService on Azure as shown below. Choose the name of the app that you want to create. Example., ATPWebApp

After it is published on Azure, you can check the 'Azure Activity Log' that says "Published" 

Run the web app

After the deployment, you can invoke the servlet at http://<webappname><servletname>
Login to Azure website and under "AppServices" you can your web app. You can start/stop/restart your webapp. 


Nirmala Sundarappa

Principal Product Manager

My name is Nirmala Sundarappa. I am the Product Manager for Oracle Java Database Connectivity (JDBC) driver and Universal Connection Pool (UCP) used with Oracle Database. 

Previous Post

Podcast #369: Software to Save the Earth

Bob Rhubart | 5 min read

Next Post

Recommendations and pool configuration tips to avoid connection leaks/shortages for UCP applications

Yuri Dolgov | 3 min read