ATP Oracle 19c Connection to Micronaut in Java using cloud wallet

Ankit Wasankar
2 min readNov 27, 2020
ATP Oracle 19c Connection to Micronaut in Java 11 using cloud wallet

Oracle Autonomous Database is a family of products with each member of the family optimized by workload. Autonomous Data Warehouse (ADW) and Autonomous Transaction Processing (ATP) are the two products that have been released in 2018.

Java applications require Java Key Store (JKS) or Oracle wallets to connect to ATP or ADW. These wallet files can be downloaded from the DB Connection tab. The enhancements in JDBC driver in DB 19c and 18.3 make Java connectivity to ATP or ADW very simple.

How to perform ATP Oracle 19c Connection to Micronaut in Java 11 using cloud wallet

Prerequisites

Once we have ATP database, download the Client Credentials, (from oracle cloud, you can download as below)

Screenshot — describing how to download wallet from Oracle Cloud ATP Database

The wallet will contain below files, (you need to extract the files from wallet archive)

Screenshot: Content of downloaded wallet

Add Maven dependencies to your pom.xml

<dependency>
<groupId>com.oracle.database.jdbc</groupId>
<artifactId>ojdbc10</artifactId>
<version>19.8.0.0</version>
</dependency>
<dependency>
<groupId>com.oracle.database.security</groupId>
<artifactId>oraclepki</artifactId>
<version>19.8.0.0</version>
</dependency>
<dependency>
<groupId>com.oracle.database.security</groupId>
<artifactId>osdt_core</artifactId>
<version>19.8.0.0</version>
</dependency>
<dependency>
<groupId>com.oracle.database.security</groupId>
<artifactId>osdt_cert</artifactId>
<version>19.8.0.0</version>
</dependency>

Setup with Intellij -

This can also work without intellij as you will understand what all VM parameters needs to add while running application.

  • In application.yml file setup the setup “datasource URL” as below
Screenshot: How to set application.yml file property values

In the run configuration, add the VM arguments as below

-Doracle.net.tns_admin="path/to/wallet/"
-Djavax.net.ssl.trustStore="path/to/wallet/truststore.jks"
-Djavax.net.ssl.trustStorePassword="Console password"
-Djavax.net.ssl.keyStore="path/to/wallet/keystore.jks"
-Djavax.net.ssl.keyStorePassword="password you set"
-Doracle.net.ssl_server_dn_match=true
-Doracle.net.ssl_version="1.2"
-DdataSource.username=admin (username you provided)
-DdataSource.password=db-password (password you provided)

An then click apply. Try to run the project and the application will connect to database

Any questions or queries, let me know in comments ?

--

--