Skip to Content
avatar image
Former Member

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

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

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • avatar image
    Former Member
    May 18 at 02:57 PM

    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

    Add comment
    10|10000 characters needed characters exceeded