gpt4 book ai didi

python - 在 ubuntu 64bit 上使用 python2.7 连接到 oracle9i

转载 作者:行者123 更新时间:2023-12-04 19:20:04 29 4
gpt4 key购买 nike

操作系统:Ubuntu 13.10 64bit
python :2.7.5
Oracle 数据库:Oracle 9i(远程)

如何使用python连接到oracle?

最佳答案

我能够使用 cx_Oracle 成功连接到 Oracle模块。 (CentOs 5.9、Python 2.7.5、Oracle 10)

代码将类似于:

import cx_Oracle

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

连接到 Oracle 后,您可以创建一个 Cursor 对象进行查询。

关于python - 在 ubuntu 64bit 上使用 python2.7 连接到 oracle9i,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23147875/

29 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com