Search code examples
javajdbcteradataclob

Teradata createClob: function not supported in this version. Is this a bug or a feature?


I am trying to test createClob() method

String conStr  = "jdbc:teradata://...";  
Class.forName("com.teradata.jdbc.TeraDriver"); 
Connection conn = DriverManager.getConnection(conStr, "user", "pass"); 

Clob clobTest = conn.createClob(); 

However it throws the following error

Exception in thread "main" java.sql.SQLException: [Teradata JDBC Driver] [TeraJDBC 15.00.00.20] [Error 165] [SQLState HY000] createClob: function not supported in this version
    at com.teradata.jdbc.jdbc_4.util.ErrorFactory.makeDriverJDBCException(ErrorFactory.java:94)
    at com.teradata.jdbc.jdbc_4.util.ErrorFactory.makeDriverJDBCException(ErrorFactory.java:69)
    at com.teradata.jdbc.jdbc_4.TDSession.createClob(TDSession.java:1479)

I downloaded the latest version of jdbc
Why the error? What does it mean ?


Solution

  • The javadoc of createClob() says:

    SQLException - if an object that implements the Blob interface can not be constructed, this method is called on a closed connection or a database access error occurs.
    SQLFeatureNotSupportedException - if the JDBC driver does not support this data type

    So technically this should have thrown a SQLFeatureNotSupportedException if Teradata does not support blobs, but that is just a minor 'bug'.

    The only thing you can do is file an improvement request to ask them to implement this.