|
2 | 2 | /*
|
3 | 3 | DESCRIPTION
|
4 | 4 | The code sample shows how to use the JDBC driver and UCP to establish a
|
5 |
| - connection to the Autonomous Database (ADB) using database token |
| 5 | + connection to the Autonomous Database (ADB) using access token |
6 | 6 | issued by the OCI Identity service.
|
7 | 7 |
|
8 | 8 | Step 1: Enter the DB_URL to pointing to your Autonomous Database (ADB)
|
9 | 9 | Step 2: Make sure to have either 21.4.0.0.1 or 19.13.0.0.1 or later versions of
|
10 | 10 | JDBC driver and UCP (ucp.jar) in the classpath. Both must be from the same version.
|
11 |
| - Step 2: Compile and Run the sample UCPDBTokenSample |
| 11 | + Step 3: Compile and run the sample UCPDBTokenSample |
12 | 12 |
|
13 | 13 | NOTES
|
14 | 14 | Use JDK8 and above
|
@@ -36,9 +36,17 @@ public class UCPDBTokenSample {
|
36 | 36 | // Note that you need to pass the property oracle.jdbc.tokenAuthentication=OCI_TOKEN for token authentication
|
37 | 37 | final static String DB_URL="jdbc:oracle:thin:@dbname_high?TNS_ADMIN=/Users/test/Walet/Wallet_dbname&oracle.jdbc.tokenAuthentication=OCI_TOKEN";
|
38 | 38 |
|
39 |
| - // If mutla TLS(mTLS) is disabled then, ADB connection does not require wallets. |
| 39 | + // If mutual TLS(mTLS) is disabled then, ADB connection does not require wallets. |
40 | 40 | // Copy the connection string from "DB Connection" tab from "Connection Strings" section choosing "TLS" in the dropdown
|
41 |
| - //final static 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=gebfdferevpozhjbqbs_dbname_medium.adb.oraclecloud.com)))?oracle.jdbc.tokenAuthentication=OCI_TOKEN"; |
| 41 | + //final static 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=gebqererpozhjbqbs_dbname_medium.adb.oraclecloud.com)))?oracle.jdbc.tokenAuthentication=OCI_TOKEN"; |
| 42 | + |
| 43 | + // Enable IAM token authentication using long form connection string. |
| 44 | + /* |
| 45 | + final static String DB_URL="jdbc:oracle:thin:@(description=" |
| 46 | + + "(retry_count=20)(retry_delay=3)(address=(protocol=tcps)(port=1521)(host=adb.us-phoenix-1.oraclecloud.com))" |
| 47 | + + "(security=(token_auth=OCI_TOKEN))" |
| 48 | + + "(connect_data=(service_name=gebfdferevpozhjbqbs_dbname_medium.adb.oraclecloud.com)))"; |
| 49 | + */ |
42 | 50 |
|
43 | 51 | final static String CONN_FACTORY_CLASS_NAME="oracle.jdbc.pool.OracleDataSource";
|
44 | 52 |
|
|
0 commit comments