2 Using Maven and Gradle
The following sections provide information about how to connect to Oracle Autonomous Database using a Maven project or a Gradle project.
Topics:
2.1 Using a Maven Project
You can establish a connection to Oracle Autonomous Database using a Maven project.
2.1.1 Setting Up a Maven Project
This section lists the steps to set up a Maven project.
2.1.2 Building and Running a Sample Java Program
This section lists the steps to build and run a sample Java program.
pom.xml
file is present.
Sample Output:
The screenshot below shows the queried rows, along with a success message:

Note:
If you connect to the Oracle Database from behind a firewall, you will likely encounter a connection timeout error. Make sure to be outside the firewall while running this sample or update the tnsnames.ora
file to use an HTTPS proxy.
See Also:
Using Oracle Autonomous AI Database Serverless for more information.2.2 Using a Gradle Project
You can establish a connection to Oracle Autonomous Database using a Gradle project.
2.2.1 Setting Up a Gradle Project
This section lists the steps to set up a Gradle project.
2.2.2 Building and Running the Gradle Application
This section lists the steps to build and run the Gradle application.
build.gradle
file is present.
The screenshot below shows the queried rows, along with a success message:

Note:
If you connect to Oracle Autonomous Database from behind a firewall, you will likely encounter a connection timeout error. Make sure to be outside the firewall while running this sample or update the tnsnames.ora
file to use an HTTPS proxy.
See Also:
Using Oracle Autonomous AI Database Serverless for more information.