← Back to team overview

sikuli-driver team mailing list archive

Re: [Question #403530]: [error] ImportError ( No module named pyodbc )

 

Question #403530 on Sikuli changed:
https://answers.launchpad.net/sikuli/+question/403530

    Status: Open => Answered

masuo proposed the following answer:
My sample codes may help you.
This is using zxJDBC to access SQLite3 Database.
When you want to access SQL Server, you have to change such as JDBC driver.

[sample codes:]
load("C:\jdbcdriver\sqlite-jdbc-3.8.6.jar")
from com.ziclix.python.sql import zxJDBC

url = "jdbc:sqlite:c:/sqlitedb/sample.db3"
dbuser = ""
dbpassword = ""
driver = "org.sqlite.JDBC"

dbconn = zxJDBC.connect(url, dbuser, dbpassword, driver)
dbcur = dbconn.cursor()

try: 
    dbcur.execute("select id, name from member")
    rs = dbcur.fetchall()
    for elm in rs:
        print elm[0], elm[1]

except Exception, e:
    print e.args[0]

finally:
    dbcur.close()
    dbconn.close()

-- 
You received this question notification because your team Sikuli Drivers
is an answer contact for Sikuli.