简体   繁体   English

读取嵌入式H2数据库

[英]Reading an embedded H2 database

I am using a 3rd party application written in Java which uses a local embedded H2 database to store data. 我正在使用用Java编写的第三方应用程序,该应用程序使用本地嵌入式H2数据库存储数据。

I want to write a Python app to read this data, and possibly write it back. 我想编写一个Python应用程序以读取此数据,并可能将其写回。 There are a lot of suggestions around about using the Postgress engine in SQLAlchemy to achieve this however what I gather from this is I would need to install some kind of server on the local machine. 关于在SQLAlchemy中使用Postgress引擎来实现此目标,有很多建议,但是我从中收集的信息是,我需要在本地计算机上安装某种服务器。 I'm getting stuck at this point. 我现在被困住了。 Is there away around this, to access it more like a file to run SQL queries against it locally.This would also aid packaging (when I get to that). 有没有解决的办法,可以像访问文件一样在本地对其进行SQL查询来访问它,这也将有助于打包(当我到达时)。

H2 supports using the PostgreSQL ODBC driver by acting like a PostgreSQL server. H2通过像PostgreSQL服务器一样支持使用PostgreSQL ODBC驱动程序。

You will need to start H2 in server mode. 您将需要在服务器模式下启动H2。

You can read about it here: 你可以在这里读到它:

http://www.h2database.com/html/advanced.html#odbc_driver http://www.h2database.com/html/advanced.html#odbc_driver

http://www.theserverside.com/news/thread.tss?thread_id=46456 http://www.theserverside.com/news/thread.tss?thread_id=46456

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM