diff --git a/start.py b/start.py index 2d2f6c8..d00d950 100644 --- a/start.py +++ b/start.py @@ -90,16 +90,20 @@ def start_ws(): def test_oracle_connect(): try: - import oracledb + import cx_Oracle un = 'mfsb' cs = '192.168.77.1:1521/v3' pw = '00QgSiB1' - with oracledb.connect(user=un, password=pw, dsn=cs) as connection: - with connection.cursor() as cursor: - print('connect') - #sql = """select sysdate from dual""" - #for r in cursor.execute(sql): - # print(r) + connection = cx_Oracle.connect(user=un, password=pw, + dsn=cs) + cursor = connection.cursor() + sql='SELECT * FROM MFSB.OBSTATE' + cursor.execute(sql) + for row in cursor: + print(row) + + cursor.close() + connection.close() except Exception as err: logging.error(traceback.format_exc())