【发布时间】:2018-06-18 12:17:23
【问题描述】:
我有一个 H2 数据库在自己的 openshift 中运行。我正在尝试弄清楚如何使用我的 spring-boot 应用并将其连接到我的 H2 容器。
在我的 spring-boot 应用程序中,我的 application.properties 文件夹中有以下配置:
# H2
spring.h2.console.enabled=true
spring.h2.console.path=/h2
# Datasource
#spring.datasource.url=jdbc:h2:file:~/test
spring.datasource.url=jdbc:h2:mem:testdb;
spring.datasource.platform=h2
spring.datasource.username=sa
spring.datasource.password=
spring.jpa.hibernate.ddl-auto=none
spring.datasource.continue-on-error=true
spring.datasource.initialization-mode=always
spring.datasource.driver-class-name=org.h2.Driver
spring.profiles.active=h2
我为 H2 和 spring 应用程序设置了路线和服务。 H2 的路由是http://database-h2-route-openshift.com,并且在端口 1521 上。将 URL 放入 application.properties 是行不通的
【问题讨论】:
-
我正在寻找一个类似的解决方案,你有这个工作吗?你能分享一下你的想法吗?