摘要: importpymssqlclassMSSQL:"""对pymssql的简单封装pymssql库,该库到这里下载:http://www.lfd.uci.edu/~gohlke/pythonlibs/#pymssql使用该库时,需要在Sql Server Configuration Manager里面将TCP/IP协议开启用法:"""def__init__(self,host,user,pwd,db):self.host=hostself.user=userself.pwd=pwdself.db=dbdef__GetConnect(se 阅读全文
posted @ 2013-07-23 22:20 预见者 阅读(2213) 评论(0) 推荐(0) 编辑
摘要: pymssql methodsset_max_connections(number)-- Sets maximum number of simultaneous database connections allowed to be open at any given time. Default is 25.get_max_connections()-- Gets current maximum number of simultaneous database connections allowed to be open at any given time.Connection(pymssqlCn 阅读全文
posted @ 2013-07-23 22:19 预见者 阅读(781) 评论(0) 推荐(0) 编辑
摘要: 先来一个简单的例子吧:?12345678910importMySQLdbtry:conn=MySQLdb.connect(host='localhost',user='root',passwd='root',db='test',port=3306)cur=conn.cursor()cur.execute('select * from user')cur.close()conn.close()exceptMySQLdb.Error,e:print"Mysql Error %d: %s"%(e.ar 阅读全文
posted @ 2013-07-23 22:09 预见者 阅读(247) 评论(0) 推荐(0) 编辑
摘要: The following identifiers are used as reserved words, orkeywordsof the language, and cannot be used as ordinary identifiers. They must be spelled exactly as written here:False class finally is returnNone continue for lambda tryTrue def from ... 阅读全文
posted @ 2013-07-23 21:53 预见者 阅读(315) 评论(0) 推荐(0) 编辑