View content of embedded H2 database started by Spring

前端 未结 7 1003
忘掉有多难
忘掉有多难 2020-12-04 09:53

I would like to view in a web browser the content of the H2 database started by Spring thanks to the following configuration:



        
相关标签:
7条回答
  • 2020-12-04 10:36

    I was facing similar issue. But the fix was really very small. Please refer page : https://springframework.guru/using-the-h2-database-console-in-spring-boot-with-spring-security/ for more details.

    In my case, I have added scope of H2 dependency as "runtime". I removed it and it fixed my issue. Not I am able to see tables in H2-console.

    Previous dependency in my pom was :

    <dependency>
        <groupId>com.h2database</groupId>
        <artifactId>h2</artifactId>
        <scope>runtime</scope>
    </dependency>
    

    And new dependency which fixed my issue :

    <dependency>
        <groupId>com.h2database</groupId>
        <artifactId>h2</artifactId>
    </dependency>
    
    0 讨论(0)
提交回复
热议问题