From d154b645d42290696d3d1fb3c5ad995ea8a9b82e Mon Sep 17 00:00:00 2001 From: Nirmala Sundarappa Date: Fri, 6 Feb 2026 17:18:03 -0800 Subject: [PATCH 1/3] Clarify connection URL usage in ADBQuickStart.java Added comments to clarify connection URL usage for different one-way and mTLS authentication methods. --- java/jdbc/ConnectionSamples/ADBQuickStart.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/java/jdbc/ConnectionSamples/ADBQuickStart.java b/java/jdbc/ConnectionSamples/ADBQuickStart.java index 0fb53395..b1d756f5 100644 --- a/java/jdbc/ConnectionSamples/ADBQuickStart.java +++ b/java/jdbc/ConnectionSamples/ADBQuickStart.java @@ -57,6 +57,10 @@ public static void main(String args[]) throws Exception { // to pass TNS_ADMIN as part of a connection URL. // TNS_ADMIN - Should be the path where the client credentials zip (wallet_dbname.zip) file is downloaded. // dbname_medium - It is the TNS alias present in tnsnames.ora. + // NOTE: Use the connection URL below when Mutual Authentication is enabled and Oracle Wallets are required. + final String DB_URL="jdbc:oracle:thin:@dbname_medium?TNS_ADMIN=/Users/test/wallet_dbname/"; + // Use the below connection URL when One-way Authentication is enabled and Oracle Wallets are not required. + // Copy the URL final String DB_URL="jdbc:oracle:thin:@dbname_medium?TNS_ADMIN=/Users/test/wallet_dbname/"; // Update the Database Username and Password to point to your Autonomous Database final String DB_USER = "admin"; From a5bec572b3e93f61d41c5f9b1e0ea81304ed5e4f Mon Sep 17 00:00:00 2001 From: Nirmala Sundarappa Date: Fri, 6 Feb 2026 17:34:07 -0800 Subject: [PATCH 2/3] Refine comments and set DB_PASSWORD in ADBQuickStart Updated connection URL comments for clarity and added password initialization. --- .../jdbc/ConnectionSamples/ADBQuickStart.java | 20 +++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/java/jdbc/ConnectionSamples/ADBQuickStart.java b/java/jdbc/ConnectionSamples/ADBQuickStart.java index b1d756f5..595a565b 100644 --- a/java/jdbc/ConnectionSamples/ADBQuickStart.java +++ b/java/jdbc/ConnectionSamples/ADBQuickStart.java @@ -53,18 +53,22 @@ online transaction processing operations. The Star Schema Benchmark (SSB) sample public class ADBQuickStart { public static void main(String args[]) throws Exception { - // Make sure to have Oracle JDBC driver 18c or above - // to pass TNS_ADMIN as part of a connection URL. - // TNS_ADMIN - Should be the path where the client credentials zip (wallet_dbname.zip) file is downloaded. + // Case 1: Use the below URL when Mutual Authentication is enabled and Oracle Wallets are required. + // Make sure to have Oracle JDBC driver 18c or above to pass TNS_ADMIN as part of a connection URL. + // TNS_ADMIN - Should be the path where the client credentials zip (wallet_dbname.zip) file is downloaded + // and the required Oracle SSO Wallets are available. // dbname_medium - It is the TNS alias present in tnsnames.ora. - // NOTE: Use the connection URL below when Mutual Authentication is enabled and Oracle Wallets are required. - final String DB_URL="jdbc:oracle:thin:@dbname_medium?TNS_ADMIN=/Users/test/wallet_dbname/"; - // Use the below connection URL when One-way Authentication is enabled and Oracle Wallets are not required. - // Copy the URL final String DB_URL="jdbc:oracle:thin:@dbname_medium?TNS_ADMIN=/Users/test/wallet_dbname/"; + + // Case 2: Use below URL when One-way Authentication is enabled and Oracle Wallets are not required. + // Copy the URL Copy the TLS URL from the OCI console by navigating to your Autonomous AI Database Details page + // and clicking on Database Connection. Under TLS Authentication, select TLS to copy the connection string for the database. + // The connection string looks like the one below. + // final String DB_URL="jdbc:oracle:thin:@(description=(retry_count=20)(retry_delay=3)(address=(protocol=tcps)(port=1521)(host=adb.us-phoenix-1.oraclecloud.com))(connect_data(service_name=testservice_jdbctestdb_high.adb.oraclecloud.com))(security=(ssl_server_dn_match=yes)))"; + // Update the Database Username and Password to point to your Autonomous Database final String DB_USER = "admin"; - String DB_PASSWORD = null ; + String DB_PASSWORD = "changepassword" ; final String CONN_FACTORY_CLASS_NAME="oracle.jdbc.pool.OracleDataSource"; // For security purposes, you must enter the password through the console From 63201294294a83671012556c14f3b387d0da7693 Mon Sep 17 00:00:00 2001 From: Nirmala Sundarappa Date: Fri, 6 Feb 2026 17:43:37 -0800 Subject: [PATCH 3/3] Update JDBC connection sample documentation Updated the URL to address 1way and mTLS and updated the comments. --- java/jdbc/ConnectionSamples/ADBQuickStart.java | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/java/jdbc/ConnectionSamples/ADBQuickStart.java b/java/jdbc/ConnectionSamples/ADBQuickStart.java index 595a565b..43ea2149 100644 --- a/java/jdbc/ConnectionSamples/ADBQuickStart.java +++ b/java/jdbc/ConnectionSamples/ADBQuickStart.java @@ -4,7 +4,7 @@ /* DESCRIPTION - The code sample demonstrates establishing a connection to Autonomous Database (ATP/ADW) using + The code sample demonstrates establishing a connection to Oracle Autonomous Database using Oracle JDBC driver and Universal Connection Pool (UCP). It does the following. (a) Set the connection factory class name to @@ -17,8 +17,11 @@ Oracle JDBC driver and Universal Connection Pool (UCP). It does the following. Step 1: Enter the Database details DB_URL and DB_USER. You will need to enter the DB_PASSWORD of your Autonomous Database through console while running the sample. - Step 2: Download the latest Oracle JDBC driver(ojdbc8.jar) and UCP (ucp.jar) + Step 2: Download the latest Oracle JDBC driver(ojdbc17.jar) and UCP (ucp17.jar) from Oracle 26ai release. along with oraclepki.jar, osdt_core.jar and osdt_cert.jar and add to your classpath. + https://www.oracle.com/database/technologies/appdev/jdbc-downloads.html + -- For 26ai and 23ai clients: only oraclepki.jar is required in the classpath. + -- Older versions, 21c or 19c: oraclepki.jar, osdt_core.jar, and osdt_cert.jar are required in the classpath. Refer to https://www.oracle.com/database/technologies/maven-central-guide.html Step 3: Compile and Run the sample. @@ -34,6 +37,7 @@ online transaction processing operations. The Star Schema Benchmark (SSB) sample MODIFIED (MM/DD/YY) nbsundar 11/09/2020 - Creation + nbsundar 2/6/2026 - Update */ package com.oracle.jdbctest; @@ -61,7 +65,7 @@ public static void main(String args[]) throws Exception { final String DB_URL="jdbc:oracle:thin:@dbname_medium?TNS_ADMIN=/Users/test/wallet_dbname/"; // Case 2: Use below URL when One-way Authentication is enabled and Oracle Wallets are not required. - // Copy the URL Copy the TLS URL from the OCI console by navigating to your Autonomous AI Database Details page + // Copy the TLS URL from the OCI console by navigating to your Autonomous AI Database Details page // and clicking on Database Connection. Under TLS Authentication, select TLS to copy the connection string for the database. // The connection string looks like the one below. // final String DB_URL="jdbc:oracle:thin:@(description=(retry_count=20)(retry_delay=3)(address=(protocol=tcps)(port=1521)(host=adb.us-phoenix-1.oraclecloud.com))(connect_data(service_name=testservice_jdbctestdb_high.adb.oraclecloud.com))(security=(ssl_server_dn_match=yes)))";