db = oracle.connect('XXX/XXX@IP地址:端口/sid_name')#换成自己远程要连的库
c = db.cursor() # 获取cursor
x = c.execute("select * from XXX WHERE XXX") # 使用cursor进行各种查询操作
rows = c.fetchall()
for row in rows:
for v in row:
print(v)
c.close() # 关闭cursor
db.close() # 关闭连接
if __name__ == '__main__':
main()
复制代码
然而上来就是个error! Cannot locate a 64-bit Oracle Client library: “The specified module could not be found”.
开始了漫长而无头绪的检索和阅读和尝试!没用的略过,有效的两步如下:
二、下载orcl instantclient