Skip to content

Commit eb37d27

Browse files
Documentation improvements.
1 parent 05a9097 commit eb37d27

File tree

2 files changed

+40
-3
lines changed

2 files changed

+40
-3
lines changed

doc/src/user_guide/connection_handling.rst

Lines changed: 38 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -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

14511488
Connecting to Sharded Databases

doc/src/user_guide/introduction.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ Features
5050

5151
The cx_Oracle feature highlights are:
5252

53-
* Easily installed from PyPI
53+
* Easy installation from PyPI
5454
* Support for multiple Oracle Client and Database versions
5555
* Execution of SQL and PL/SQL statements
5656
* Extensive Oracle data type support, including large objects (CLOB and
@@ -104,7 +104,7 @@ Simple :ref:`connection <connhandling>` to the database requires a username,
104104
password and connection string. Locate your Oracle Database `user name and
105105
password <https://www.youtube.com/watch?v=WDJacg0NuLo>`_ and the database
106106
:ref:`connection string <connstr>`, and use them in ``query.py``. For
107-
cx_Oracle the connection string is commonly of the format
107+
cx_Oracle, the connection string is commonly of the format
108108
``hostname/servicename``, using the host name where the database is running and
109109
the Oracle Database service name of the database instance.
110110

0 commit comments

Comments
 (0)