update : 09.01.2025 16:15:30,23
This commit is contained in:
parent
ebdb4835d0
commit
2872157281
18
start.py
18
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())
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user