【问题标题】:Spring boot Connect with PostgreSqlSpring Boot 与 PostgreSql 连接
【发布时间】:2020-07-16 16:42:53
【问题描述】:

附上的代码是SpringBoot连接数据库时的错误,问题是应用程序尝试检查数据库时,提示如下错误,SpringBoot的java版本是11,postgre版本是11,所以版本都是最新的

错误:

Caused by: org.postgresql.util.PSQLException: This ResultSet is closed.
Caused by: org.hibernate.exception.GenericJDBCException: Unable to open JDBC Connection for DDL execution

属性文件:

spring.jpa.database=POSTGRESQL
spring.datasource.platform=org.hibernate.dialect.PostgreSQL9Dialect
spring.datasource.url=jdbc:postgresql://localhost:5432/spring
spring.datasource.username=postgres
spring.datasource.password=123456
spring.jpa.show-sql=true
spring.jpa.generate-ddl=true
spring.jpa.hibernate.ddl-auto=create-drop
spring.datasource.driverClassName=org.postgresql.Driver
spring.jpa.properties.hibernate.jdbc.lob.non_contextual_creation=true 


【问题讨论】:

  • 你的mysql连接器驱动是哪个版本的?
  • 在 pom.xml 中更新你的 JDBC 驱动版本
  • 我没有带有成绩管理依赖的 pom.xml
  • 我使用的是 PostgreSQL 驱动,版本 9。

标签: java postgresql spring-boot web-applications


【解决方案1】:

问题已通过更新 JDBC 驱动程序的版本解决,因为 JDBC 驱动程序应与本地 PostgreSQL 版本同步。

【讨论】:

    猜你喜欢
    • 2019-06-12
    • 2020-11-06
    • 2020-08-24
    • 2020-06-26
    • 2021-01-02
    • 2016-09-14
    • 1970-01-01
    • 2021-09-20
    • 2020-03-14
    相关资源
    最近更新 更多