#!/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()