Mac platform
Last updated
Was this helpful?
Was this helpful?
import oracledb
import cryptography
import os
cs = '''<user>/<password>@(DESCRIPTION = (ADDRESS = (PROTOCOL = TCPS)(HOST = oraclessl<service name>dnd-efwyu.qarel.tsl-barc.cloud)(PORT = 1521))(CONNECT_DATA = (SERVICE_NAME = <service name>))(SECURITY = (SSL_SERVER_CERT_DN = "CN=oraclessl<service name>dnd-efwyu.qarel.tsl-barc.cloud")))'''
oracledb.init_oracle_client(lib_dir="/Users/<user>/orainscli/instantclient_19_8/")
connection = oracledb.connect(user="<user>", password="<password>", dsn=cs)
cursor = connection.cursor()
cur = cursor.execute("SELECT sys_context('USERENV', 'NETWORK_PROTOCOL') as network_protocol, sys_context('USERENV', 'AUTHENTICATION_METHOD') as authentication_method FROM dual")
print(cur.fetchall())
connection.close()