Python3.5在Windows 7下链接ORACLE数据库

一、首先须要安装好oracle数据库,本机适用plsql链接数据库正常,记录下数据库名称python

image

二、安装cx_oracle模块sql

pip install cx_Oracle数据库

三、python中引入模块oracle

import cx_Oracle as cx测试

四、测试fetch

conn = cx.connect('sys/password@localhost/orcl')   
cursor = conn.cursor () 
cursor.execute ("select * from dual") 
row = cursor.fetchone () 
print (row)   
cursor.close () 
conn.close ()  blog

相关文章
相关标签/搜索