database 管理H2数据库的前端工具

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/2760887/
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

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-08 07:42:47  来源:igfitidea点击:

Frontend tool to manage H2 database

databaseh2database-administration

提问by blow

How to use H2 database's integrated managment frontend?

如何使用H2数据库的集成管理前端?

For operations such as create table, alter table, add column, and so on.

用于创建表、更改表、添加列等操作。

采纳答案by trashgod

I like SQuirreL SQL Client, and NetBeansis very useful; but more often, I just fire up the built-in org.h2.tools.Serverand browse port 8082:

我喜欢的SQuirreL SQL客户端,以及NetBeans的非常有用的; 但更多时候,我只是启动内置的org.h2.tools.Server并浏览端口 8082:

$ java -cp /opt/h2/bin/h2.jar org.h2.tools.Server -help
Starts the H2 Console (web-) server, TCP, and PG server.
Usage: java org.h2.tools.Server 
When running without options, -tcp, -web, -browser and -pg are started.
Options are case sensitive. Supported options are:
[-help] or [-?]         Print the list of options
[-web]                  Start the web server with the H2 Console
[-webAllowOthers]       Allow other computers to connect - see below
[-webPort ]       The port (default: 8082)
[-webSSL]               Use encrypted (HTTPS) connections
[-browser]              Start a browser and open a page to connect to the web server
[-tcp]                  Start the TCP server
[-tcpAllowOthers]       Allow other computers to connect - see below
[-tcpPort ]       The port (default: 9092)
[-tcpSSL]               Use encrypted (SSL) connections
[-tcpPassword ]    The password for shutting down a TCP server
[-tcpShutdown ""]  Stop the TCP server; example: tcp://localhost:9094
[-tcpShutdownForce]     Do not wait until all connections are closed
[-pg]                   Start the PG server
[-pgAllowOthers]        Allow other computers to connect - see below
[-pgPort ]        The port (default: 5435)
[-baseDir ]        The base directory for H2 databases; for all servers
[-ifExists]             Only existing databases may be opened; for all servers
[-trace]                Print additional trace information; for all servers

回答by Joonas Pulakka

回答by Hubat

I use sql-workbenchfor working with H2 and any other DBMS I have to deal with and it makes me smile :-)

我使用sql-workbench来处理 H2 和我必须处理的任何其他 DBMS,这让我微笑:-)

回答by vinay

I would like to suggest DBEAVER.it is based on eclipse and supports better data handling

我想建议DBEAVER .它基于 eclipse 并支持更好的数据处理

回答by sync

There's a shell client built in too which is handy.

还有一个内置的shell客户端,很方便。

java -cp h2*.jar org.h2.tools.Shell

http://opensource-soa.blogspot.com.au/2009/03/how-to-use-h2-shell.html

http://opensource-soa.blogspot.com.au/2009/03/how-to-use-h2-shell.html

$ java -cp h2.jar org.h2.tools.Shell -help
Interactive command line tool to access a database using JDBC.
Usage: java org.h2.tools.Shell <options>
Options are case sensitive. Supported options are:
[-help] or [-?]        Print the list of options
[-url "<url>"]         The database URL (jdbc:h2:...)
[-user <user>]         The user name
[-password <pwd>]      The password
[-driver <class>]      The JDBC driver class to use (not required in most cases)
[-sql "<statements>"]  Execute the SQL statements and exit
[-properties "<dir>"]  Load the server properties from this directory
If special characters don't work as expected, you may need to use
 -Dfile.encoding=UTF-8 (Mac OS X) or CP850 (Windows).
See also http://h2database.com/javadoc/org/h2/tools/Shell.html

回答by RedFilter

I haven't used it, but RazorSQLlookspretty good.

我没用过,但RazorSQL看起来不错。

回答by David Groomes

I would suggest Jetbrain's IDE: DataGrip https://www.jetbrains.com/datagrip/

我建议使用 Jetbrain 的 IDE:DataGrip https://www.jetbrains.com/datagrip/

回答by Iain

If you are running it as an embedded database in spring I use the following configuration to enable the built in web client when the main app is running:

如果您在 spring 中将其作为嵌入式数据库运行,我将使用以下配置在主应用程序运行时启用内置 Web 客户端:

<!-- Run H2 web server within application that will access the same in-memory database -->
<bean id="h2Server" class="org.h2.tools.Server" factory-method="createTcpServer" init-method="start" destroy-method="stop" depends-on="h2WebServer">
    <constructor-arg value="-tcp,-tcpAllowOthers,-tcpPort,9092"/>
</bean>
<bean id="h2WebServer" class="org.h2.tools.Server" factory-method="createWebServer" init-method="start" destroy-method="stop">
    <constructor-arg value="-web,-webAllowOthers,-webPort,8082"/>
</bean>

回答by Aydin K.

I use DbVisualizer a lot for H2-db administration.

我经常使用 DbVisualizer 进行 H2-db 管理。

There exists a free version:

有一个免费版本:

https://www.dbvis.com/download/

https://www.dbvis.com/download/