How to run H2 database in server mode?

前端 未结 5 398
谎友^
谎友^ 2020-12-02 11:46

How to start H2 database in server mode. I need to start it from my application.I tried the following code:

server = Server.createTcpServer().start();
         


        
5条回答
  •  生来不讨喜
    2020-12-02 12:01

    From command line,

    java -jar h2-1.3.160.jar -webAllowOthers -tcpAllowOthers
    

    this will launch an h2 database in server mode:

    Web Console server running at http://A.B.C.D:8082 (others can connect)
    TCP server running at tcp://A.B.C.D:9092 (others can connect)
    PG server running at pg://A.B.C.D:5435 (only local connections)
    

    open a browser to have an admin GUI

提交回复
热议问题