Postgres Error method org.postgresql.jdbc.PgConnection.createClob() 未实现
2022-09-02 09:10:15
当我使用连接对象调用方法时,如下所示: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中添加了以下Postgres依赖项.xml
<dependency>
<groupId>org.postgresql</groupId>
<artifactId>postgresql</artifactId>
<version>42.1.1</version>
</dependency>
在类中,createClob 实现如下所示,它抛出了异常:org.postgresql.jdbc.PgConnection
@Override
public Clob createClob() throws SQLException {
checkClosed();
throw org.postgresql.Driver.notImplemented(this.getClass(), "createClob()");
}
解决此问题的解决方案或解决方法是什么?或者我们如何在Postgres查询中设置CLOB数据?