我从远程计算机使用H2数据库作为DBMS,因此我启用了从浏览器远程访问,如下所示:
webAllowOthers=true
Run Code Online (Sandbox Code Playgroud)
但是当我尝试从我的java应用程序连接到服务器时,我从H2获得此错误:
remote connections to this server are not allowed
Run Code Online (Sandbox Code Playgroud)
截图:

并且已经在查找代码分析器(错误代码:90117):
REMOTE_CONNECTION_NOT_ALLOWED = 90117
如果不允许远程连接,则尝试从另一台计算机连接到TCP服务器时会引发代码90117的错误.要允许远程连接,请使用选项-tcpAllowOthers启动TCP服务器,如下所示:
java org.h2.tools.Server -tcp -tcpAllowOthers
或者,从应用程序启动服务器时,使用: Server server = Server.createTcpServer(" - tcpAllowOthers"); server.start();
我不明白如何激活tcpAllowOthers,它在.h2.server.properties中不存在?