I use H2 Database as DBMS from a remote computer,so I enabled remote access from a browser as follows:
webAllowOthers=true
but when i try to connect to the server from my java application i get this error from H2:
remote connections to this server are not allowed
screenshot:
And also already looking into the code Analyzer with (Error Code: 90117):
REMOTE_CONNECTION_NOT_ALLOWED = 90117
The error with code 90117 is thrown when trying to connect to a TCP server from another machine, if remote connections are not allowed. To allow remote connections, start the TCP server using the option -tcpAllowOthers as in:
java org.h2.tools.Server -tcp -tcpAllowOthers
Or, when starting the server from an application, use: Server server = Server.createTcpServer("-tcpAllowOthers"); server.start();
I do not understand how to activate the tcpAllowOthers, it does not exist in .h2.server.properties ?
There are two different server:
jdbc:h2:tcp://localhost/~/test
)The file .h2.server.properties
is only used for the Web Console server. It only supports webAllowOthers=true
. This file is not used by the TCP server.
To enable remote access to the TCP server, you need to start the TCP server using the option -tcpAllowOthers
. To start both the Web Console server (the H2 Console tool) and the TCP server with remote connections enabled, you would need to use:
java -jar h2*.jar -web -webAllowOthers -tcp -tcpAllowOthers -browser
(this also starts a browser)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With