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

前端 未结 10 1040
误落风尘
误落风尘 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:25

    Version of jar file and installed h2 database should be same.

    0 讨论(0)
  • 2021-02-01 03:26

    In my case the issue was caused by the fact that I didn't set the h2 username, password in java. Unfortunatelly, Spring didn't display any errors to me, so it was not easy to figure out. Adding this lines to dataSource method helped me fix the issue:

    dataSource.setUsername("sa");
    dataSource.setPassword("");
    

    Also, I should have specified the schema when creating tables in schema.sql

    0 讨论(0)
  • 2021-02-01 03:29

    You can use the SHOW command:

    grammar

    Using this command, you can lists the schemas, tables, or the columns of a table. e.g.:

    SHOW TABLES
    
    0 讨论(0)
  • 2021-02-01 03:32

    If in case you have created and populated H2 database table using maven dependency in spring boot, then please do change the JDBC URL as jdbc:h2:mem:testdb while connecting to H2 using web console.

    0 讨论(0)
提交回复
热议问题