#!/usr/env/bin Python
-*-coding:utf-8 -*-
#導入數據庫連接模塊
import sqlanydb
user='dba'
passwd='hwfx123'
host='localhost:5000'
_sql = """select getdate()"""
# 連接到數據庫
con = sqlanydb.connect(userid=user, passWord=passwd, host=host)
# 執行SQL語句
cur = con.cursor()
cur.execute(_sql)
# 獲取執行結果
current_date = cur.fetchall()[0]
print 'current date is', current_date
cur.close()
con.close()