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