import cx_Oracle
def orace_update(sql):
conn = cx_Oracle.connect("cashpay", "cashpay", "10.164.200.241:1521/topccms")
cursor = conn.cursor()
cursor.execute(sql)
conn.commit()
conn.close()
def orace_query(sql):
conn = cx_Oracle.connect("cashpay", "cashpay", "10.164.200.241:1521/topccms")
cursor = conn.cursor()
cursor.execute(sql)
result = cursor.fetchall()
cursor.close()
conn.close()
return result
def execute_query_sql(sql):
host = "10.164.204.101"
port = 3306
db_user = "cmis"
db_pwd = "cmis"
db = "cmis_db"
conn = pymysql.connect(host=host, port=port, user=db_user, passwd-db_pwd, db=db, use_unicode-True, charset="utf8")
cursor = conn.cursor()
cursor.execute(sql)
conn.commit()
cursor.close()
conn.close()
def execute_query_sql(sql):
host = "10.164.204.101"
port = 3306
db_user = "cmis"
db_pwd = "cmis"
db = "cmis_db"
conn = pymysql.connect(host=host, port=port, user=db_user, passwd-db_pwd, db=db, use_unicode-True, charset="utf8")
cursor = conn.cursor()
cursor.execute(sql)
db_data = cursor.fetchall()
cursor.close()
conn.close()
return db_data