Sikuli connect to Sql Server from command line

Asked by David Flood on 2019-09-25

What are these instruction doing and how do I run them . I am wanting to connect sql server database form Sikuli ide with Jython. This may seem confused, because I am. !

Place the sqljdb.jar in c:\JDBC . Extract the files to this directory .
You now need Java’s jar.exe execuatable.
Place the jar.exe in c:\JDBC

jar uf “C:\Program Files\Sikuli X\sikuli-script.jar” com
jar uf “C:\Program Files\Sikuli X\sikuli-script.jar” microsoft

This will take everything in the com directory and place it into the sikuli-script.jar. The next line does the same thing with the Microsoft directory structure.

Question information

Language:
English Edit question
Status:
Answered
For:
Sikuli Edit question
Assignee:
No assignee Edit question
Last query:
2019-10-02
Last reply:
2019-10-03
RaiMan (raimund-hocke) said : #1

what is the question?

David Flood (doolf112) said : #2

Thank you for replying, and apologies for the rambling nature of my question. I am trying to connect Sikuli 1.1.3 using the IDE and Jython to a SQL server database.

url = "jdbc:sqlserver://ddd-alt-us01.firm.uk;DatabaseName=bkr900;sendStringParametersAsUnicode=False"
dbuser = "Test.Testing"
dbpassword = "Test3r!"
driver = "com.microsoft.sqlserver.jdbc.SQLServerDriver"
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]

Get error message.

[error] Error caused by: Traceback (most recent call last): File "C:\alpen1.sikuli\alpen1.py", line 6, in <module> dbconn = zxJDBC.connect(url, dbuser, dbpassword, driver) zxJDBC.DatabaseError: driver [com.microsoft.sqlserver.jdbc.SQLServerDriver] not found

-----Original Message-----
From: <email address hidden> <email address hidden> On Behalf Of RaiMan
Sent: 26 September 2019 14:58
To: David Flood <email address hidden>
Subject: Re: [Question #684246]: Sikuli connect to Sql Server from command line

Your question #684246 on Sikuli changed:
https://answers.launchpad.net/sikuli/+question/684246

    Status: Open => Needs information

RaiMan requested more information:
what is the question?

--
To answer this request for more information, you can either reply to this email or enter your reply at the following page:
https://answers.launchpad.net/sikuli/+question/684246

You received this question notification because you asked the question.

________________________________________
The receiver of this message is required to check if he/she has received it erroneously. If so, the receiver is requested to immediately inform the sender and - in consideration of the responsibilities arising from undue use and/or disclosure of the message and/or the information contained therein - destroy the original message and any copy or printout thereof.

Chi riceve il presente messaggio e' tenuto a verificare se lo stesso non gli sia pervenuto per errore. In tal caso e' pregato di avvisare immediatamente il mittente e, tenuto conto delle responsabilita' connesse all'indebito utilizzo e/o divulgazione del messaggio e/o delle informazioni in esso contenute, voglia cancellare l'originale e distruggere le varie copie o stampe.

;

RaiMan (raimund-hocke) said : #3

I cannot see any imports????

Where do you have the MS-driver jar-file?

From where did you get the information in the original question at the top?

RaiMan (raimund-hocke) said : #4
David Flood (doolf112) said : #5

Thanks for the replying, this is definitely useful. I am trying to connect to Sqlserver db , what are the equivalent of the mysql connections. Sorry not a full time techie.

David

set cp=<some-folder>/mysql-connector-java-5.1.21/mysql-connector-java-5.1.21-bin.jar
set cp=%cp%:<some-other-folder>/jython.jar
java -cp %cp% org.python.util.jython %1.sikuli/%1.py

-----Original Message-----
From: <email address hidden> <email address hidden> On Behalf Of RaiMan
Sent: 27 September 2019 15:43
To: David Flood <email address hidden>
Subject: Re: [Question #684246]: Sikuli connect to Sql Server from command line

Your question #684246 on Sikuli changed:
https://answers.launchpad.net/sikuli/+question/684246

RaiMan posted a new comment:
Not sure wether this might help:
https://answers.launchpad.net/sikuli/+question/202408

--
You received this question notification because you asked the question.

________________________________________
The receiver of this message is required to check if he/she has received it erroneously. If so, the receiver is requested to immediately inform the sender and - in consideration of the responsibilities arising from undue use and/or disclosure of the message and/or the information contained therein - destroy the original message and any copy or printout thereof.

Chi riceve il presente messaggio e' tenuto a verificare se lo stesso non gli sia pervenuto per errore. In tal caso e' pregato di avvisare immediatamente il mittente e, tenuto conto delle responsabilita' connesse all'indebito utilizzo e/o divulgazione del messaggio e/o delle informazioni in esso contenute, voglia cancellare l'originale e distruggere le varie copie o stampe.

;

RaiMan (raimund-hocke) said : #6

--- set cp=<some-folder>/mysql-connector-java-5.1.21/mysql-connector-java-5.1.21-bin.jar

this has to be adapted to your situation:

you need the jar file, that contains "com.microsoft.sqlserver.jdbc.SQLServerDriver"

Can you help with this problem?

Provide an answer of your own, or ask David Flood for more information if necessary.

To post a message you must log in.