Reputation: 1
I am trying to test JayDeBeApi by accessing a local HSQL database on my computer. I have set up the database and I know there is data in it, but I am getting nothing when I run my code.
My table is called PA0101.ALERT_PRIORITY. It has the following data.
PRIORITY_CD PRIORITY_DN 1 High 2 Medium 3 Low
Here is my code.
import jaydebeapi
import os
os.environ['JAVA_HOME'] = 'C:\Program Files\Java\jdk1.8.0_191'
conn = jaydebeapi.connect("org.hsqldb.jdbc.JDBCDriver",
"jdbc:hsqldb:hsql://localhost/xdb",
["SA", "SA"],
"C:\\PATH\\hsqldb.jar")
curs = conn.cursor()
curs.execute("SELECT * FROM PA0101.ALERT_PRIORITY")
curs.fetchall()
curs.close()
conn.close()
I have tried putting inserts in the curs.execute statement, and gotten a "you don't have permission or object nott found" exception.
Fixed this. Just needed to incase the curs.fetchall() in a print().
Upvotes: 0
Views: 291