cancel
Showing results for 
Search instead for 
Did you mean: 

Method createClob() of Connection is not supported in ngdbc driver?

Former Member

We have an application that we are trying to migrate from Oracle to SAP Hana. Our application calls the creatClob() method whenever we insert clob data into our tables. Whenever the createClob() method is called, we get the following error message.

Caused by: com.sap.db.jdbc.exceptions.SQLFeatureNotSupportedExceptionSapDB: Method createClob() of Connection is not supported.

I am running off of the following driver version:
2.2.6-8c722062a23edf49f36f1af73a5a2c5e70910ee2

Is the createClob feature not supported by ngdbc?

Is there a work around for this?

Is the feature planned for the future?

Thanks for any help

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member

For those interested, I was able to find a work around for this using TO_CLOB. Ill include a link below. Essentially, we use TO_CLOB to create our clob with a PreparedStatement. Store the results into an ResultSet and use getClob to retrieve the our CLOB. I'll include a code snippet.

String s = "Dummy's Clob";
// incon is an parameter
Connection con = incon; 
s = s.replaceAll("'","''"); // add in escape sequence for '. 
PreparedStatement dummyclob = con.prepareStatement("SELECT TO_CLOB ('" + s + "') FROM DUMMY;");
ResultSet rs = dummyclob.executeQuery();
Clob clob = null;
if (rs.next()) {
  clob = rs.getClob(1);
}


return clob;

http://sap.optimieren.de/hana/hana/html/sql_function_to_clob.html