继续尝试PygreSQL的pgdb

发表于:2007-06-07来源:作者:点击数: 标签:
2005-2-24: 继续Python+Postgre SQL 的学习,今天的体会就是,来自于社区的东西才是最有活力和生命力的:) 今天尝试一下pgdb,也是PostgreSQL推荐使用的module,在使用前,先要安装一个egenix-mx-base的module (http://www.egenix.com/files/python/eGen
 2005-2-24:
继续Python+PostgreSQL的学习,今天的体会就是,来自于社区的东西才是最有活力和生命力的:)

今天尝试一下pgdb,也是PostgreSQL推荐使用的module,在使用前,先要安装一个egenix-mx-base的module (http://www.egenix.com/files/python/eGenix-mx-Extensions.html#Download-mxBASE)

然后尝试一下代码:

java代码: 
MILY: 'Courier New',Courier,monospace">

import pgdb

conn = pgdb.connect(host='localhost',databse='qingfeng',user='qingfeng',password='123')

cur = conn.cursor()

cur.execute("select * from dream")

print cur.rowcount

原文转自:http://www.ltesting.net