How to connect to Autonomous Database from Java Application?
Content
I have referred this article https://docs.oracle.com/en/cloud/paas/atp-cloud/atpug/connect-preparing.html#GUID-3667EC68-930E-4566-95B3-DFA24203A8FF.
Referred Sample from github: https://github.com/oracle/oracle-db-examples/blob/master/java/jdbc/ConnectionSamples/DataSourceSample.java
Set the environmental variable TS_ADMIN to ''E:\Oracle Cloud Learnings\Oracle ATP credentials" (This is the directory where my wallet files are located)
JDK version : 1.8.0_202
Code:
final static String DB_URL="jdbc:oracle:thin:@dbtransprocess_tpurgent?TNS_ADMIN=E://Oracle Cloud Learnings//Oracle ATP credentials";
final static String DB_USER = "XYZ";
final static String DB_PASSWORD = "abcd";
Tagged:
1