How to show content of local h2 database(web console)?

后端 未结 3 740
予麋鹿
予麋鹿 2021-02-07 04:55

Recently I joined a new team and here guys use h2 for stub service.

I was wondering whether I can show the content of this database using web interface. At work it is av

3条回答
  •  春和景丽
    2021-02-07 05:40

    You ought to be able to use the in-memory or file-based variants, and then in your application fire up the H2 TCP server separately, e.g. using a Spring bean (mind the semi-pseudo code and sample port):

    @Component
    class Bootstrap {
        @PostConstruct
        public void startH2TcpServer() {
             Server.createTcpServer("-tcpPort", "9123", "-tcpDaemon").start();
        }
    }
    

    See http://www.h2database.com/html/tutorial.html#using_server

提交回复
热议问题