[Tutor] query result set
Shawn Matlock
matlocs at odscompanies.com
Tue Nov 9 02:58:36 CET 2010
I am able to successfully query a MySQL database using zxJDBC but the result set seems odd to me. It returns the following:
[(u'envDB', u'systest2'), (u'envDir', u'st2'), (u'envCellName', u'Systest2Cell'), (u'envFrontEnd', u'systest2FrontEnd'), (u'envTag', u'system_test2')]
Why is there a "u" before every entry? Can someone point me to an example that puts the results into a List (or Dictionary) without the "u"?
Thank you,
Shawn
csdbConn = zxJDBC.connect("jdbc:mysql://myhost:3306/mydb", "User", "Password", "com.mysql.jdbc.Driver")
csdbCursor = csdbConn.cursor(1)
envsql = "select envVariable, envValue from ODS_ENV_DICT where envName = 'ST2'"
csdbCursor.execute(envsql)
print csdbCursor.fetchall()
csdbCursor.close()
csdbConn.close()
More information about the Tutor
mailing list