我有一個帶有 H2 資料庫的 Spring Boot 應用程式。我可以添加條目,我可以在 swagger-ui 網站上看到這些條目。

但是當我打開 H2 控制臺時,我看不到表或列。

有沒有辦法向我展示資料庫的內容?以可讀的格式?
我的 application.properties 檔案:
spring.datasource.url=jdbc:h2:mem:mooddb;
spring.datasource.driverClassName=org.h2.Driver
spring.datasource.username=a
spring.datasource.password=a
spring.jpa.database-platform=org.hibernate.dialect.H2Dialect
spring.sql.init.platform=h2
spring.jpa.hibernate.ddl-auto=create
spring.sql.init.data-locations=classpath:data-h2.sql
spring.h2.console.enabled=true
spring.jpa.show-sql=true
spring.jpa.properties.hibernate.format_sql=true
spring.jpa.defer-datasource-initialization=true
spring.h2.console.path=/h2
spring.h2.console.settings.trace=false
spring.h2.console.settings.web-allow-others=false
感謝
uj5u.com熱心網友回復:
h2 控制臺可用于執行 SQL 查詢,以便您可以查看資料庫的內容。
例如SELECT * FROM YOUR_TABLE;,您可以執行,您將在控制臺中看到查詢的結果。
轉載請註明出處,本文鏈接:https://www.uj5u.com/qiye/402474.html
標籤:
上一篇:web瀏覽器及網頁概念
