我有一个项目。它适用于application.properties数据库,也适用于本地postgre数据库,配置如下
spring.datasource.url=myUrl
spring.datasource.username=myUsername
spring.datasource.password=myPassword但是,当我试图在Heroku中部署它时,会得到以下错误:
由:org.hibernate.HibernateException引起:当“hibernate.dialect”未设置时,对DialectResolutionInfo的访问不能为null
如果我使用这个配置
spring.jpa.database-platform=org.hibernate.dialect.PostgreSQLDialect
spring.datasource.driverClassName=org.postgresql.Driver
spring.datasource.url=herokuPostgreSqlDbUrl
spring.datasource.username=herokuUsername
spring.datasource.password=mherokuPassword当尝试从STS运行我的项目并失败部署时,我就会得到这个结果。
由: java.sql.SQLException: Driver:org.postgresql.Driver@17a3dff6为URL:myUrl返回null
我的目标是:
<dependency>
<groupId>org.postgresql</groupId>
<artifactId>postgresql</artifactId>
<version>9.4-1206-jdbc42</version>
</dependency>有人能帮忙吗?
发布于 2017-01-19 17:42:50
您需要一个适当的JDBC url。请参阅:https://springframework.guru/configuring-spring-boot-for-postgresql/
https://stackoverflow.com/questions/41746572
复制相似问题