Method org.postgresql.jdbc4.Jdbc4Statement.setQueryTimeout(int) is not yet implemented错误解决

2022-09-07 15:40:43 浏览数 (1)

大家好,又见面了,我是你们的朋友全栈君。

17:25:17:166 [Druid-ConnectionPool-Create-1566729816] ERROR log=c.a.d.p.DruidDataSource,traceId=,userId=,msg=create connection SQLException, url: jdbc:postgresql://…:5432/…, errorCode 0, state 0A000,org.postgresql.util.PSQLException: Method org.postgresql.jdbc4.Jdbc4Statement.setQueryTimeout(int) is not yet implemented. at org.postgresql.Driver.notImplemented(Driver.java:753) at org.postgresql.jdbc2.AbstractJdbc2Statement.setQueryTimeout(AbstractJdbc2Statement.java:656) at com.alibaba.druid.pool.vendor.PGValidConnectionChecker.isValidConnection(PGValidConnectionChecker.java:64) at com.alibaba.druid.pool.DruidAbstractDataSource.validateConnection(DruidAbstractDataSource.java:1346) at com.alibaba.druid.pool.DruidAbstractDataSource.createPhysicalConnection(DruidAbstractDataSource.java:1633) at com.alibaba.druid.pool.DruidDataSource$CreateConnectionThread.run(DruidDataSource.java:2468)

由于postgresql版本问题导致的,将postgresql的版本改成如下:

代码语言:javascript复制
 <dependency>
      <groupId>org.postgresql</groupId>
      <artifactId>postgresql</artifactId>
      <version>42.0.0</version>
    </dependency>

再次执行之后,一切OK!

发布者:全栈程序员栈长,转载请注明出处:https://javaforall.cn/149528.html原文链接:https://javaforall.cn

0 人点赞