1. 程式人生 > >cx_Oracle 連接數據庫腳本

cx_Oracle 連接數據庫腳本

cursor cx_oracle blsp data oracle 連接 pri conn imp lsp

import cx_Oracle as oracle
db = oracle.connect(blsdm/BLS_admin01@blsprod01.c2dlljmccmd3.ap-southeast-1.rds.amazonaws.com:1521/orcl)
cursor = db.cursor()
cursor.execute(select sysdate from dual)
data = cursor.fetchone()
print(Database time:%s % data)
cursor.close()
db.close()

cx_Oracle 連接數據庫腳本