sikuli connect postgre database

Asked by kiyo

I am sorry to bother you .I can not find any method to connect postgre database,can you give me any suggestion?

Question information

Language:
English Edit question
Status:
Expired
For:
SikuliX Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
Tak Eda (takeda) said :
#1

What have you tried so far?

If you want pointers to get started, look here: http://stackoverflow.com/questions/468763/how-to-connect-to-database-from-jython

Please post your code after reading the above

Revision history for this message
kiyo (532433917-6) said :
#2

can i use pg module connect it?

Revision history for this message
kiyo (532433917-6) said :
#3

i have try the method you said ,idownload zxJDBC
jar and put it into my project,and i also
set the jar as classpath
my code:
import sys
from com.ziclix.python.sql import zxJDBC

connection1 = zxJDBC.connect('jdbc:odbc:test_odbc', 'postgres', 'postgres', 'sun.jdbc.odbc.JdbcOdbcDriver')
print "JDBC:ODBC connection set"
connection2 = zxJDBC.connect('jdbc:postgresql://127.0.0.1/test?stringtype=unspecified', 'postgres', 'postgres', 'org.postgresql.Driver')
print "JDBC native connection set"

log
    connection1 = zxJDBC.connect('jdbc:odbc:test_odbc', 'postgres', 'postgres', 'sun.jdbc.odbc.JdbcOdbcDriver')
zxJDBC.DatabaseError: driver [sun.jdbc.odbc.JdbcOdbcDriver] not found

Revision history for this message
masuo (masuo-ohara) said :
#4

If you are using SikuliX1.1.0
Simple solution,I think you can use the load().

I use sikuliX1.1.0 in windows.
For example,
load("c:/driver/postgresql-xxxxxxxx.jar")

Revision history for this message
Launchpad Janitor (janitor) said :
#5

This question was expired because it remained in the 'Open' state without activity for the last 15 days.