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

print('H2 from Python (DB API 2.0, JDBC, JayDeBeApi)')
con = jaydebeapi.connect('org.h2.Driver', 'jdbc:h2:tcp://192.168.0.10/test;FILE_LOCK=FS', ['sa', 'hemmeligt'], 'h2-1.2.147.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()
