1.首先安装cx_oracle包
2.解压instantclient-basic-windows.x64-11.2.0.4.0.zip到c:\oracle
3.拷贝instantclient_11_2下所有.dll文件到c:\python34\lib\site-packages\下(根据自己的python版本拷贝到相应的site-packages文件夹下)
python连接示例代码:
# -*- coding: utf-8 -*-import cx_Oracle
conn=cx_Oracle.connect('reporter','password','localhost:1521/ORCL')
cursor=conn.cursor()
sql="select * from test"cursor.execute(sql)
data=cursor.fetchall()print(data)
cursor.close()
conn.commit()
conn.close()
python怎么学习?python怎么入门?python在哪学?python怎么学才快?不用担心,这里为大家提供了python速学教程(入门到精通),有需要的小伙伴保存下载就能学习啦!
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号