I have a set of python scripts that use cx_Oracle to connect to a remote DB. This is a large project, were this connections are used several times. Additionally, I produce an .exe file that is distributed and should be as self-contained as possible. In other words, if I send you the .exe, you should be able to run it without any extra tinkering (I use pyinstaller )
Right now, I get a connection using
ip = 'myhost.example.pt'
port = 1521
SID = 'MYDB_PRD.EXAMPLE.PT'
dsn_tns = cx_Oracle.makedsn(ip, port, service_name=SID)
con = cx_Oracle.connect(username_bd, password_bd, dsn_tns, encoding='UTF-8')
The object con
is used thorough the script, always as the connection argument for a pandas read_sql
function call.
Everything is ok, except that my DB Admins are asking to setup this connection using ldap. I've search around, and the only solution I find to do it involves creating a file somewhere on the client... Is there no other way? Can't I pass the ldap configurations directly on the script?