Connect to MySQL DB using zxJDBC in a Sikuli script
#! / Usr / bin / env python
# - * - codificação: utf-8 - * -
import jarray
from guide import *
from sikuli import *
import codecs
class classPathHacker
"""Original Author: SG Langer Jan 2007, conversion from Java to Jython
Updated version (supports Jython 2.5.2) From http://
Purpose: Allow runtime additions of new Class/jars either from
local files or URL
"""
import java.lang.
import java.io.File
import java.net.URL
import java.net.
def addFile(self, s):
"""Purpose: If adding a file/jar call this first
with s = path_to_jar"""
# make a URL out of 's'
f = self.java.
u = f.toURL()
a = self.addURL(u)
return a
def addURL(self, u):
"""Purpose: Call this with u= URL for
the new Class/jar to be loaded"""
sysloader = self.java.
sysclass = self.java.
method = sysclass.
a = method.
jar_a = jarray.array([u], self.java.
b = method.
return u
tmp = classPathHacker()
tmp.addFile(
from com.ziclix.
db = zxJDBC.
C = db.cursor()
#C.execute("insert into status values(
#C.execute ("select * from usuario")
#C.execute("insert into status values (?)", ['Passou'])
C.execute ("select * from status")
#C.execute(sql)
for a in C.fetchall():
uni = unicode(a,'utf-8')
print repr(uni)
soon after,nothing happens.
I'am listed the bank and there were results
sorry my english
Question information
- Language:
- English Edit question
- Status:
- Answered
- For:
- SikuliX Edit question
- Assignee:
- No assignee Edit question
- Last query:
- Last reply:
Can you help with this problem?
Provide an answer of your own, or ask Radamanthys for more information if necessary.