gpt4 book ai didi

java - 如何解决 org.postgresql.jdbc.PgConnection.createClob() 尚未实现

转载 作者:行者123 更新时间:2023-11-29 12:01:45 25 4
gpt4 key购买 nike

异常

启动 spring-boot 应用程序时我收到了:

引起:java.sql.SQLFeatureNotSupportedException:方法 org.postgresql.jdbc.PgConnection.createClob() 尚未实现。

我知道这与我现在使用的 Postgresql 驱动程序的一些问题有关。

尝试失败

许多人解决了这个问题只是将下面这行放在 application.properties 文件中:

spring.jpa.properties.hibernate.temp.use_jdbc_metadata_defaults=true

我仍然有同样的问题。它还有其他提示吗?如果考虑使用当前配置查看我的项目: https://github.com/caliari77/hiRank

最佳答案

经过一些测试我可以解决这个问题。似乎缺少 Hibernate 实现,所以为了解决这个问题,我在 gradle.build 文件中添加了它。我以为在获取 JPA 时 Spring-boot 已经解决了它,但我错了。这是我从 gradle.build 更新的依赖项:

dependencies {

//Spring
//implementation 'org.springframework.boot:spring-boot-starter-actuator'
implementation 'org.springframework.boot:spring-boot-starter-data-jpa'
implementation 'org.springframework.boot:spring-boot-starter-web'
//runtimeOnly 'org.springframework.boot:spring-boot-devtools'
testImplementation 'org.springframework.boot:spring-boot-starter-test'

//Hibernate
implementation 'org.hibernate:hibernate-core:5.4.2.Final'
implementation 'org.hibernate:hibernate-entitymanager:5.4.2.Final'

//Postgres
implementation 'org.postgresql:postgresql:42.2.5.jre7'

//Gson
implementation 'com.google.code.gson:gson:2.8.5'

//Logger
implementation 'log4j:log4j:1.2.17'

关于java - 如何解决 org.postgresql.jdbc.PgConnection.createClob() 尚未实现,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55732898/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com