【发布时间】:2020-08-22 01:09:55
【问题描述】:
在将 Coacroach Db 与 Spring Boot 和 Spring Batch 一起使用时,我收到以下错误。
org.postgresql.util.PSQLException: ERROR: invalid value for parameter "TimeZone": "Europe/London"
详情:系统找不到指定的路径。
Application.properties
spring.datasource.driver-class-name=org.postgresql.Driver
spring.jpa.properties.hibernate.dialect=org.hibernate.dialect.PostgreSQL95Dialect
spring.datasource.username=root
spring.datasource.password=
spring.datasource.type=com.zaxxer.hikari.HikariDataSource
spring.datasource.url=jdbc:postgresql://localhost:26257/defaultdb?sslmode=disable&serverTimezone=UTC&useLegacyDatetimeCode=false
spring.jpa.properties.hibernate.jdbc.time_zone= UTC
spring.batch.initialize-schema = always
我还添加了这个和上面提到的属性,但没有帮助。
@PostConstruct
void started() {
TimeZone.setDefault(TimeZone.getTimeZone("UTC"));
}
【问题讨论】:
标签: spring spring-boot spring-data-jpa spring-batch cockroachdb