How to run H2 database in server mode?

前端 未结 5 390
谎友^
谎友^ 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 11:53

    You can use the following code to run H2 in server mode.

    
        
        
        
        
    
    

    You can use SQuirrel SQL client (http://squirrel-sql.sourceforge.net/) to connect to you H2 database and look at the tables.

    1. Create new connection.
    2. Select H2 in the driver dropdown menu
    3. Set url to your project target folder h2 folder (jdbc:h2:C:\projects\workspace\TestProject\target/h2/ps;AUTO_SERVER=true)
    4. Enter user name ("sa")
    5. Enter password ("")

提交回复
热议问题