详细讲解Oracle入门
oracle数据库连接
# 公共数据库连接 improt cx_Oracle def query_cfg(sql): url='hxods4dc/111111@10.16.1.93/ora11j' db=cx_Oracle.connect(url) cursor= db.cursor() try: cursor.execute(sql) row_2 = cursor.fetchall() title =[i[0] for i in cursor.description] logger.info(f'执行{sql},结果为:{row_2,title}') return row_2,title except Exception as e: logger.warning(f'报错:{e},sql为{sql}') print(e) finally: cursor.close() db.close() # 增删改查数据库连接 def query_idu(sql): url='hxods4dc/111111@10.16.1.93/ora11j' db=cx_Oracle.connect(url) cursor= db.cursor() try: cursor.execute(sql) logger.info(f'执行增删改:{sql}') db.commit() except Exception as e: logger.warning(f'报错:{e},sql为{sql}') print(e) finally: cursor.close() db.close()
oracle数据库操作管理器
PLSQL软件
安装包