@@ -1389,7 +1389,7 @@ There are now two options:
13891389 SSL_SERVER_DN_MATCH=yes
13901390
13911391 Since the ``tnsnames.ora `` and ``sqlnet.ora `` files are not in the default
1392- location, your application needs to indicate where they are, either with
1392+ location, your application needs to indicate where they are, either with the
13931393 ``config_dir `` parameter to :meth: `cx_Oracle.init_oracle_client() `, or using
13941394 the ``TNS_ADMIN `` environment variable. See :ref: `Optional Oracle Net
13951395 Configuration Files <optnetfiles>`. Neither of these settings are needed,
@@ -1446,6 +1446,43 @@ name you plan to use, for example::
14461446 (https_proxy=myproxy.example.com)(https_proxy_port=80)
14471447 (protocol=tcps)(port=1522)(host= . . . )
14481448
1449+ Using the Easy Connect Syntax with Autonomous Database
1450+ ------------------------------------------------------
1451+
1452+ When cx_Oracle is using Oracle Client libraries 19c or later, you can
1453+ optionally use the :ref: `Easy Connect <easyconnect >` syntax to connect to
1454+ Oracle Autonomous Database.
1455+
1456+ The mapping from the cloud ``tnsnames.ora `` entries to an Easy Connect Plus
1457+ string is::
1458+
1459+ protocol://host:port/service_name?wallet_location=/my/dir&retry_count=N&retry_delay=N
1460+
1461+ For example, if your ``tnsnames.ora `` file had an entry::
1462+
1463+ cjjson_high = (description=(retry_count=20)(retry_delay=3)
1464+ (address=(protocol=tcps)(port=1522)
1465+ (host=adb.ap-sydney-1.oraclecloud.com))
1466+ (connect_data=(service_name=abc_cjjson_high.adb.oraclecloud.com))
1467+ (security=(ssl_server_cert_dn="CN=adb.ap-sydney-1.oraclecloud.com,OU=Oracle ADB SYDNEY,O=Oracle Corporation,L=Redwood City,ST=California,C=US")))
1468+
1469+ Then your applications can connect using the connection string:
1470+
1471+ .. code-block :: python
1472+
1473+ dsn = " tcps://adb.ap-sydney-1.oraclecloud.com:1522/abc_cjjson_high.adb.oraclecloud.com?wallet_location=/Users/cjones/Cloud/CJJSON&retry_count=20&retry_delay=3"
1474+ connection = cx_Oracle.connect(user = " hr" , password = userpwd, dsn = dsn,
1475+ encoding = " UTF-8" )
1476+
1477+ The ``wallet_location `` parameter needs to be set to the directory containing
1478+ the ``cwallet.sso `` file from the wallet ZIP. The other wallet files,
1479+ including ``tnsnames.ora ``, are not needed when you use the Easy Connect Plus
1480+ syntax.
1481+
1482+ You can add other Easy Connect parameters to the connection string, for example::
1483+
1484+ dsn = dsn + "&https_proxy=myproxy.example.com&https_proxy_port=80"
1485+
14491486.. _connsharding :
14501487
14511488Connecting to Sharded Databases
0 commit comments