puhs2_test.py 319 B

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