← Back to team overview

sikuli-driver team mailing list archive

Re: [Question #697147]: Error connecting SikuliX 2.0.5 to sqlserver using zxJDBC

 

Question #697147 on SikuliX changed:
https://answers.launchpad.net/sikuli/+question/697147

Description changed to:
My team at work has been using this below to successfully connect to our
database and execute a query for 5 years now:

```load("sqljdbc4-2.0.jar")
from com.ziclix.python.sql import zxJDBC
connection = zxJDBC.connect('jdbc:sqlserver://xxx.xxx.x.xxx', 'xxx', 'xxx','com.microsoft.sqlserver.jdbc.SQLServerDriver')
cursor = connection.cursor()
SQLCommand = importQuery.readFile('C:\\testQuery.sql')
cursor.execute(SQLCommand)
result = list(cursor)
connection.commit()
connection.close()```

After this, we then loop through each row and execute tests based off of
the results that we get from our query.

This has never worked with SikuliIDE-2.0.0 or later, and we haven't been
able to get it to connect with the new versions, so we stuck with 1.1.2
as we had the least issues with that version. With the latest Java
update we are no longer able to use the older versions and want to
update to the latest version of Sikuli, 2.0.5.

When I run in 2.0.5, I get the following error on the second line (from
com.ziclix.python.sql import zxJDBC):

[error] script [ 1389693genExY&YTforWorksheetOnlyRerunInY ] stopped with error in line 56
[error] java.lang.NoClassDefFoundError ( java.lang.NoClassDefFoundError: Could not initialize class com.ziclix.python.sql.zxJDBC )
[error] --- Traceback --- error source first
line: module ( function ) statement 
56: main (  <module> )     from com.ziclix.python.sql import zxJDBC
[error] --- Traceback --- end --------------

We have tried updating the jdbc jar to mssql-jdbc-9.2.1.jre15.jar, and
changed our first line to reference that, with just the name of it and
with putting in the full path before it (although it used to always work
without the path, just with  load("sqljdbc4-2.0.jar"), but without
success.

We also tried following the solution from
https://answers.launchpad.net/sikuli/+question/242975 without success.

Any help would be greatly appreciated!

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