add python test code with pyodbc

This commit is contained in:
freemine 2020-10-11 06:39:36 +08:00
parent 77703ac809
commit e88979de90
1 changed files with 12 additions and 0 deletions

View File

@ -0,0 +1,12 @@
import pyodbc
cnxn = pyodbc.connect('DSN=TAOS_DSN;UID=root;PWD=taosdata', autocommit=True)
cnxn.setdecoding(pyodbc.SQL_CHAR, encoding='utf-8')
#cnxn.setdecoding(pyodbc.SQL_WCHAR, encoding='utf-8')
#cnxn.setencoding(encoding='utf-8')
cursor = cnxn.cursor()
cursor.execute("SELECT * from db.t")
row = cursor.fetchone()
while row:
print(row)
row = cursor.fetchone()