How to see all tables in my h2 database at localhost:8082?

前端 未结 10 1058
误落风尘
误落风尘 2021-02-01 02:43

I use JDBC and created h2 database called usaDB from sql script. Then I filled all tables with jdbc.

The problem is that after I connect to usaDB at localhost:8082 I can

10条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2021-02-01 03:16

    I have met exactly this problem.

    From what you describe, I suppose that you connect your jdbc with the "real" h2 server, but you are connecting on web application to database by the wrong mode (embedded-in-memory mode, aka h2mem). It means that h2 will create a new database in-memory, instead of using your true database stored elsewhere.

    Please make sure that when you connect to this database, you use the mode Generic H2 (Server), NOTGeneric H2 (Embedded). You can refer to the picture below.

    enter image description here

提交回复
热议问题