Pycharm中Python3连接Oracle
时间:2021-07-01 10:21:17
帮助过:21人阅读
cx_Oracle
class My_plsq:
def my_cha(self,my_sql_c):
try:
conn = cx_Oracle.connect(
"连接名",
"密码",
"localhost/orcl")
cursor =
conn.cursor()
cursor.execute(my_sql_c)
all_data =
cursor.fetchall()
oo =
list(all_data[0])
return oo
except cx_Oracle.DatabaseError:
return print(
"无效的SQL语句")
if __name__ ==
‘__main__‘:
a=
My_plsq()
l=a.my_cha("SELECT * FROM 表名")
print(l)
亲测有效
Pycharm中Python3连接Oracle
标签:acl redis 安装 网盘下载地址 环境配置 下载地址 网盘 hal 电脑