python 读取sqlite3 数据库

 import sqlite3

 name = "tom"
age = 30
con = sqlite3.connect("d:\\test.db")
cur = con.cursor()
#cur.execute("select * from user")
cur.execute("select * from user where age = %d" %age) for x in cur:
print (x[0],x[1])
上一篇:java数据库编程之初始Mysql


下一篇:struts2中的方法过滤拦截器