When I invoke createClob
method using connection object as shown below:
Clob clob = con.createClob();
Following exception is thrown:
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)
I`m using database PostgreSQL 9.6.2 with JDK8 and using commons-dbcp2 connection pool, And added following Postgres dependency in pom.xml
<dependency>
<groupId>org.postgresql</groupId>
<artifactId>postgresql</artifactId>
<version>42.1.1</version>
</dependency>
In class org.postgresql.jdbc.PgConnection
, createClob implementation is as shown below which is throwing the exception:
@Override
public Clob createClob() throws SQLException {
checkClosed();
throw org.postgresql.Driver.notImplemented(this.getClass(), "createClob()");
}
What is the solution or workaround to overcome this issue? Or How can we set CLOB data in Postgres queries?