1.listener.ora 2.tnsnames.ora 3.sqlnet.ora
)
五、oracle数据库数据抽取调用
接下来进行数据的抽取与调用:
import cx_Oracle as cx #导入模块 con = cx.connect('root', 'root123', '127.0.0.1:1521/ORCL') #创建连接 cursor = con.cursor() #创建游标 cursor.execute("select * from ORCL where ID='28'") #执行sql语句 data = cursor.fetchone() #获取一条数据 print(data) #打印数据 cursor.close() #关闭游标 con.close() #关闭数据库连接okk啦!!
到此这篇关于教你使用Python连接oracle的文章就介绍到这了,更多相关Python连接oracle内容请搜索