1234567891011121314151617 |
- #!/usr/bin/env python
- # encoding: utf-8
- import pyhs2
- cursor = pyhs2.connect(host='localhost', port=10000).cursor()
- print cursor.getDatabases();
- #Execute query
- cur.execute("select count(*) from userinfo")
-
- #Return column info from query
- print cur.getSchema()
-
- #Fetch table results
- for i in cur.fetch():
- print i
|