【随手记录】关于Unable to create requested service[org.hibernate.engine.jdbc.env.spi.JdbcEnvironment] 错误


JPA 和 数据库配置缺失,会报错

Unable to create requested service[org.hibernate.engine.jdbc.env.spi.JdbcEnvironment]

设置下数据库相关配置即可:

# 数据库链接
spring.datasource.driver-class-name=org.postgresql.Driver
spring.datasource.url=jdbc:postgresql://192.168.1.224:5433/postgres?currentSchema=geodisaster_prevention
spring.datasource.username=postgres
spring.datasource.password=Rootroot12.
spring.jackson.time-zone=GMT+8
spring.jackson.date-format=yyyy-MM-dd HH:mm:ss
spring.datasource.maxpoolsize=5

# jpa
spring.jpa.properties.hibernate.temp.use_jdbc_metadata_defaults=false
spring.jpa.database=postgresql
spring.jpa.properties.hibernate.dialect=org.hibernate.dialect.PostgreSQLDialect