【发布时间】:2012-04-07 22:40:17
【问题描述】:
我从远程计算机使用 H2 数据库作为 DBMS,因此我启用了从浏览器进行远程访问,如下所示:
webAllowOthers=true
但是当我尝试从我的 java 应用程序连接到服务器时,我从 H2 收到此错误:
remote connections to this server are not allowed
截图:
并且还已经使用(错误代码:90117)查看代码分析器:
REMOTE_CONNECTION_NOT_ALLOWED = 90117
如果不允许远程连接,则在尝试从另一台计算机连接到 TCP 服务器时会引发代码 90117 的错误。要允许远程连接,请使用选项 -tcpAllowOthers 启动 TCP 服务器,如下所示:
java org.h2.tools.Server -tcp -tcpAllowOthers
或者,从应用程序启动服务器时,使用: 服务器服务器 = Server.createTcpServer("-tcpAllowOthers"); server.start();
我不明白如何激活tcpAllowOthers,它在.h2.server.properties中不存在?
【问题讨论】: