Python3.5在Windows 7下连接ORACLE数据库
1、首先需要安装好oracle数据库,本机适用plsql连接数据库正常,记录下数据库名称
2、安装cx_oracle模块
pip install cx_Oracle
3、python中引入模块
import cx_Oracle as cx
4、测试
conn = cx.connect('sys/password@localhost/orcl')
cursor = conn.cursor ()
cursor.execute ("select * from dual")
row = cursor.fetchone ()
print (row)
cursor.close ()
conn.close ()