cx_Oracle doesn't connect when using SID instead of service name on connection string

后端 未结 7 806
你的背包
你的背包 2020-12-13 09:14

I have a connection string that looks like this

con_str = \"myuser/mypass@oracle.sub.example.com:1521/ora1\"

Where ora1 is the

相关标签:
7条回答
  • 2020-12-13 10:08

    If you are using sqlalchemy and ORACLE 12, the following seems to work.

    from sqlalchemy import create_engine
    con='oracle://user:password@hostname:1521/?service_name=DDDD'
    engine = create_engine(con)
    

    Note, you have to use the service name and not the SID. I don't know why, but the simple connection string that uses SID does not work.

    0 讨论(0)
提交回复
热议问题