this is a simple example of adbapi use pymssql module to connect to MSSQL server.
from twisted.internet import reactor
from twisted.enterprise import adbapi
def getSites():
return dbpool.runQuery("select * from m_site")
def printResult(l):
for item in l:
print item
dbpool = adbapi.ConnectionPool("pymssql", user="sa", password="bedjo", host="192.168.31.31", database="bedjo")
getSites().addCallback(printResult)
reactor.callLater(4, reactor.stop)
reactor.run()
Thats all ... cheers
Wednesday, April 05, 2006
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment