h2 & linux。如何启动数据库?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/4559626/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
h2 & linux. how to start the database?
提问by David
sorry im rather new to linux ubuntu. i have an application that i made that runs with tomcat and connects to an h2 database. it all works fine on my windows laptop. im now moving it onto my linux computer to run all the time. but im having trouble with starting the database. i have downloaded h2 from their website. and its sitting on my desktop.
抱歉,我对 linux ubuntu 还很陌生。我有一个与 tomcat 一起运行并连接到 h2 数据库的应用程序。在我的 Windows 笔记本电脑上一切正常。我现在将它移动到我的 linux 计算机上以一直运行。但是我在启动数据库时遇到了麻烦。我已经从他们的网站下载了 h2。它坐在我的桌面上。
the question is. how to start the database.
问题是。如何启动数据库。
and is their any other commands i need to know to run and operate it.
以及我需要知道的任何其他命令来运行和操作它。
thankyous
谢谢
回答by Thomas Mueller
The H2 database supports different modes:
H2数据库支持不同的模式:
You can use H2 in embedded mode using a database URL of the form
jdbc:h2:~/test
. This is the easiest case. In that case the database is running within the same process as your application is running, and you don't have to start a separate process just for the database.You can use H2 in server mode. In that case you need to start a separate server process. But for your case it doesn't sound like you need this, right?
H2 also supports mixed mode (half embedded / half server), and the automatic mixed mode.
您可以使用表单的数据库 URL 以嵌入模式使用 H2
jdbc:h2:~/test
。这是最简单的情况。在这种情况下,数据库在与应用程序运行的进程相同的进程中运行,您不必仅为数据库启动一个单独的进程。您可以在服务器模式下使用 H2。在这种情况下,您需要启动一个单独的服务器进程。但是对于您的情况,听起来您不需要这个,对吗?
H2 还支持混合模式(半嵌入式/半服务器),以及自动混合模式。
For details, see the H2 documentation about Connection Modes.
有关详细信息,请参阅有关连接模式的 H2 文档。
回答by Faron
Is this what you are looking for?
这是你想要的?
https://groups.google.com/forum/?fromgroups=#!topic/h2-database/r-qRnskN0eQ
https://groups.google.com/forum/?fromgroups=#!topic/h2-database/r-qRnskN0eQ
回答by Khan
Open terminal in bin directory of h2 database and write these commands...
在 h2 数据库的 bin 目录中打开终端并编写这些命令...
chmod +x h2.sh
./h2.sh