Skip to content

Commit 2c308c0

Browse files
Documentation improvements.
1 parent b781d4c commit 2c308c0

File tree

1 file changed

+26
-1
lines changed

1 file changed

+26
-1
lines changed

doc/src/user_guide/connection_handling.rst

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -315,7 +315,9 @@ id=GUID-8C85D289-6AF3-41BC-848B-BF39D32648BA>`__ syntax allows the use of
315315
multiple hosts or ports, along with optional entries for the wallet location,
316316
the distinguished name of the database server, and even allows some network
317317
configuration options be set. This means that a :ref:`sqlnet.ora <optnetfiles>`
318-
file is not needed for some common connection scenarios.
318+
file is not needed for some common connection scenarios. See Oracle's
319+
`Technical Paper on Easy Connect Plus Syntax <https://download.oracle.com/
320+
ocomdocs/global/Oracle-Net-Easy-Connect-Plus.pdf>`__ for more information.
319321

320322
In python-oracledb Thin mode, any unknown Easy Connect options are ignored and
321323
are not passed to the database. See :ref:`Connection String Differences
@@ -544,6 +546,29 @@ the username, password and connection string from a DSN:
544546
545547
Empty values are returned as ``None``.
546548

549+
The :meth:`ConnectParams.get_network_service_names()` can be used to get a
550+
list of the network service names that are defined in the
551+
:ref:`tnsnames.ora <optnetfiles>` file. The directory that contains the
552+
tnsnames.ora file can be specified in the :attr:`~ConnectParams.config_dir`
553+
attribute.
554+
555+
.. code-block:: python
556+
557+
cp = oracledb.ConnectParams(host="my_host", port=my_port, dsn="orclpdb",
558+
config_dir="/opt/oracle/config")
559+
cp.get_network_service_names()
560+
561+
If the :meth:`ConnectParams.get_network_service_names()` method is called but
562+
a tnsnames.ora file does not exist, then an error such as the following is
563+
returned::
564+
565+
DPY-4026: file tnsnames.ora not found in /opt/oracle/config
566+
567+
If :attr:`~ConnectParams.config_dir` is not specified, then the following
568+
error is returned::
569+
570+
DPY-4027: no configuration directory to search for tnsnames.ora
571+
547572
When creating a standalone connection or connection pool the equivalent
548573
internal extraction is done automatically when a value is passed to the ``dsn``
549574
parameter of :meth:`oracledb.connect()` or :meth:`oracledb.create_pool()` but

0 commit comments

Comments
 (0)