Skip to content

Commit 9d1d6e5

Browse files
committed
Documentation and code edits
1 parent 9761fa2 commit 9d1d6e5

File tree

3 files changed

+10
-7
lines changed

3 files changed

+10
-7
lines changed

.vscode/launch.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,9 @@
1313
"console": "integratedTerminal",
1414
"env": {
1515
"TNS_ADMIN": "${cwd}",
16-
"DB_CONTAINER_NAME": "axer",
17-
"DB_PORT": "1521"
16+
"DB_HOST": "axer",
17+
"DB_PORT": "1521",
18+
"DB_SERVICE_NAME": "XEPDB1"
1819
}
1920
}
2021
]

app.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
import cx_Oracle
22
import os
33

4-
DB_HOST = os.environ["DB_CONTAINER_NAME"]
4+
DB_HOST = os.environ["DB_HOST"]
55
DB_PORT = os.environ["DB_PORT"]
6+
DB_SERVICE_NAME = os.environ["DB_SERVICE_NAME"]
67

7-
CONNECT_STRING = DB_HOST + ":" + DB_PORT + "/XEPDB1"
8+
CONNECT_STRING = DB_HOST + ":" + DB_PORT + "/" + DB_SERVICE_NAME
89

910
## Open a connection pool:
1011
pool = cx_Oracle.SessionPool(dsn=CONNECT_STRING, externalauth=True,

docs/oracle-database-connection-with-oracle-wallet.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -81,12 +81,13 @@ This guide assumes the following:
8181
8282
When executing the Python code, set the `TNS_ADMIN` environment variable to the directory where the `sqlnet.ora` file is located. It is important to note that when running the code within the devcontainer, the `PROJECT_ROOT` is mounted and the current working directory is set to typically a path like `/workspace/vscode-remote-oradev-python`. The leaf of the workspace path follows the name of the running devcontainer name.
8383
84-
When debugging code, add the following attributes to the [`launch.json`](../.vscode/launch.json) file, and update `DB_CONTAINER_NAME` and `DB_PORT` accordingly:
84+
When debugging code, add the following attributes to the [`launch.json`](../.vscode/launch.json) file, and update `DB_HOST` (set to the `DB_CONTAINER_NAME` when working with a database container), `DB_PORT` and `DB_SERVICE_NAME` accordingly:
8585
8686
```json
8787
"env": {
8888
"TNS_ADMIN": "${cwd}",
89-
"DB_CONTAINER_NAME": "axer",
90-
"DB_PORT": "1521"
89+
"DB_HOST": "axer",
90+
"DB_PORT": "1521",
91+
"DB_SERVICE_NAME": "XEPDB1"
9192
}
9293
```

0 commit comments

Comments
 (0)