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

how to connect to oracle using python?

有帮助吗?

解决方案

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.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top