Java Spring引导与PostgreSql的连接
附加的代码是使用SpringBoot连接数据库时出现的错误,问题是应用程序尝试检查数据库时出现的错误,它在下面说明了错误,SpringBoot使用java版本11,postgre版本使用11,因此版本都是最新的 错误:Java Spring引导与PostgreSql的连接,java,postgresql,spring-boot,web-applications,Java,Postgresql,Spring Boot,Web Applications,附加的代码是使用SpringBoot连接数据库时出现的错误,问题是应用程序尝试检查数据库时出现的错误,它在下面说明了错误,SpringBoot使用java版本11,postgre版本使用11,因此版本都是最新的 错误: Caused by: org.postgresql.util.PSQLException: This ResultSet is closed. Caused by: org.hibernate.exception.GenericJDBCException: Unable to o
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
问题通过更新JDBC驱动程序版本解决,因为JDBC驱动程序应该与本地PostgreSQL版本同步。问题通过更新JDBC驱动程序版本解决,因为JDBC驱动程序应该与本地PostgreSQL版本同步。您的mysql连接器驱动程序是什么版本?在pom.xml中更新您的JDBC驱动程序版本我没有pom.xml和等级管理依赖性我使用了版本9的PostgreSQL驱动程序。什么版本是您的mysql连接器驱动程序?在pom.xml中更新您的JDBC驱动程序版本我没有具有等级管理依赖关系的pom.xml使用版本9的PostgreSQL驱动程序。