我試圖讓從python2.7至H2的連接(h2-1.4.193.jar - 最新)連接Python來H2
H2(正在運行,並且提供):java -Dh2.bindAddress=127.0.0.1 -cp "E:\Dir\h2-1.4.193.jar;%H2DRIVERS%;%CLASSPATH%" org.h2.tools.Server -tcpPort 15081 -baseDir E:\Dir\db
對於蟒蛇我使用jaydebeapi
:
import jaydebeapi
conn = jaydebeapi.connect('org.h2.Driver', ['jdbc:h2:tcp://localhost:15081/db/test', 'sa', ''], 'E:\Path\to\h2-1.4.193.jar')
curs = conn.cursor()
curs.execute('create table PERSON ("PERSON_ID" INTEGER not null, "NAME" VARCHAR not null, primary key ("PERSON_ID"))')
curs.execute("insert into PERSON values (1, 'John')")
curs.execute("select * from PERSON")
data = curs.fetchall()
print(data)
結果每次我得到一個錯誤:Process finished with exit code -1073741819 (0xC0000005)
你有關於這個情況下,任何想法?或者也許有其他的東西,我可以使用,而不是jaydebeapi
?