Question

OS: Ubuntu 13.10 64bit Python : 2.7.5 Oracle Database : Oracle 9i (remote)

how to connect to oracle using python?

Was it helpful?

Solution

I was able to connect to Oracle successfully using the cx_Oracle module. (CentOs 5.9, Python 2.7.5, Oracle 10)

The code would be something similar to:

import cx_Oracle

dsn = cx_Oracle.makedsn(host, port, sid)
db = cx_Oracle.connect(user, password, dsn)

After connecting to Oracle, you can create a Cursor object to make queries.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top