简体   繁体   中英

Spring boot Connect with PostgreSql

The attached code are the error when connect the database with SpringBoot, the Problem is when application try to check the database, it told below error, SpringBoot with java version 11, and postgre version is with 11, so the version are all latest

Error:

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

Property files:

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 


Problem is solved by updated the version of JDBC driver, since the JDBC driver should sync up with local PostgreSQL Version.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM