简体   繁体   English

H2嵌入式数据库无法正常工作

[英]H2 Database Embedded not working

Good Day, 美好的一天,

I am trying to use H2 in embedded mode on my Java Application. 我正在尝试在Java应用程序中以嵌入式模式使用H2。 Basically, not only do i need to modify my H2 database within my Java App, but I also want to access the web interface so i can see the data. 基本上,我不仅需要在Java App中修改我的H2数据库,而且我还想访问Web界面以便可以看到数据。

This is my code: 这是我的代码:

final String[] args = new String[] {
        "-tcpPort", "8092",
        "-tcpAllowOthers","true" };
private static org.h2.tools.Server serverDB;
serverDB = org.h2.tools.Server.createTcpServer(args).start();

I have then tried to access my server via the Port 8092 at localhost and i get nothing. 然后,我尝试通过本地主机上的8092端口访问服务器,但我什么也没得到。 running the .jar file directly however allows me to access the server via safari. 直接运行.jar文件,但是允许我通过野生动物园访问服务器。 Can I know what is the issue? 我能知道是什么问题吗?

好的,显然是这个

serverDB=org.h2.tools.Server.createWebServer("-webAllowOthers").start();

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

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