Wednesday, 26 January 2022

Simple JDBC program to connect with Oracle Autonomous Database

This blog post is about how to connect to Oracle Autonomous database using JDBC.

The prerequisites for this are you need a free Oracle cloud account and create a Oracle Autonomous database which is always free.

1. Create a free Oracle cloud acount

2.Create free Oracle database account

After performing above 2 steps you can download the wallet zip file from the ATP database and keep it in a folder. (Refer to this link for dowloading the wallet)

After downloading the wallet, extract the files to a folder of your choice. Create folder by name "network" in the extracted folder and create "admin" folder in the "network" folder.

Copy cwallet.sso, ojdbc.properties and tnsnames.ora to admin folder.

Now open eclipse and create a New Java project.

Download the ojdbc drivers from this location. Extract the jars and copy them into a folder and add them in the Classpath of the Java project.



Now write the java class to invoke the database.


Run the class and you should see the output as follows:

Driver Name: Oracle JDBC driver
Driver Version: 19.13.0.0.0
Database Username is: ADMINUSER

Happy learning!!




Helidon MP application using JPA With EclipseLink and Oracle ATP Database

In this blog post we will look at how to build a Helidon Microprofile application using JPA with Eclipselink as provider and Oracle Autonomo...