I am using cx_oracle to connect the Oracle DB using python.I need your assistance in connecting DB. I'm using following code till date it worked well
Code-1:
import cx_Oracle as cx dsn_tns = cx.makedsn(HOST,PORT, service_name=SERVICE_NAME)
conn = cx.connect(user=USER, password=PW, dsn=dsn_tns)
Recently TCP port is disabled and we are using jdbc connection string to connect DB which has TCPS port number.can you help where I need to pass the protocol in above/ suggest any other method.
i tried following code
code-2:
dsn_tns='(DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = tcps)(HOST =hostdetails)(PORT =port))) (CONNECT_DATA = (SERVICE_NAME = servicename)))' conn = cx.connect(user=USER, password=PW, dsn=dsn_tns) print(cx.version)
I got error: ORA-28759: failure to open file.
Any suggestion is appreciated. Thank you in advance.