# Collection of code snippets by Arne Vajhøj 
# (from articles on eksperten.dk / vajhoej.dk written sometime between 2004 and now) 
import jaydebeapi

print('HSQLDB from Python (DB API 2.0, JDBC, JayDeBeApi)')
con = jaydebeapi.connect('org.hsqldb.jdbc.JDBCDriver', 'jdbc:hsqldb:hsql://192.168.0.10/test', ['sa', 'hemmeligt'], 'hsqldb.jar',)
c = con.cursor()
c.execute('SELECT f1,f2 FROM t1')
data = c.fetchall()
c.close()
for row in data:
    print('%d %s' % (row[0], row[1]))
con.close()
