cx_Oracle with Windows authentication

不打扰是莪最后的温柔 提交于 2019-12-02 23:43:24

问题


I would like to make cx_Oracle work with Windows OS authentication but fail miserably:

  1. I know that with pyodbc you can make it work using trusted_connection='yes' but I have to make use of the Oracle client (11g/12c), which does not seem to go well in hand with pyodbc.

  2. The closest to what I need seems to be the use of Wallets. However, duplicating existing information does not seem like the way to go.

  3. There is mention of external authentication in the cx_Oracle 5.2.1 release notes but this also seems related to wallets.

I hope that some clever person out there can point me in the right direction, thanks :)


回答1:


For external authentication with cx_Oracle, the code to use is as simple as this:

import cx_Oracle

conn = cx_Oracle.connect(dsn = "the_tns_entry_name")


来源:https://stackoverflow.com/questions/44020986/cx-oracle-with-windows-authentication

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!