【发布时间】:2017-10-09 20:21:55
【问题描述】:
当我使用连接对象调用createClob 方法时,如下所示:
Clob clob = con.createClob();
抛出以下异常:
Caused by: java.sql.SQLFeatureNotSupportedException: Method org.postgresql.jdbc.PgConnection.createClob() is not yet implemented.
at org.postgresql.Driver.notImplemented(Driver.java:659)
at org.postgresql.jdbc.PgConnection.createClob(PgConnection.java:1246)
at org.apache.commons.dbcp2.DelegatingConnection.createClob(DelegatingConnection.java:868)
at org.apache.commons.dbcp2.DelegatingConnection.createClob(DelegatingConnection.java:868)
我正在使用数据库 PostgreSQL 9.6.2 和 JDK8 并使用 commons-dbcp2 连接池,并在 pom.xml 中添加了以下 Postgres 依赖项
<dependency>
<groupId>org.postgresql</groupId>
<artifactId>postgresql</artifactId>
<version>42.1.1</version>
</dependency>
在org.postgresql.jdbc.PgConnection类中,createClob实现如下图所示,抛出异常:
@Override
public Clob createClob() throws SQLException {
checkClosed();
throw org.postgresql.Driver.notImplemented(this.getClass(), "createClob()");
}
解决此问题的解决方案或解决方法是什么?或者我们如何在 Postgres 查询中设置 CLOB 数据?
【问题讨论】:
标签: java postgresql jdbc apache-commons-dbcp