{"record":{"id":"be2b32b841245edc","repo":"tursodatabase/turso","slug":"createclob-not-supported","errorCode":null,"errorMessage":"createClob not supported","messagePattern":"createClob not supported","errorType":"exception","errorClass":"SQLFeatureNotSupportedException","httpStatus":null,"severity":"error","filePath":"bindings/java/src/main/java/tech/turso/jdbc4/JDBC4Connection.java","lineNumber":268,"sourceCode":"  public PreparedStatement prepareStatement(String sql, int autoGeneratedKeys) throws SQLException {\n    return prepareStatement(sql);\n  }\n\n  @Override\n  public PreparedStatement prepareStatement(String sql, int[] columnIndexes) throws SQLException {\n    // TODO: maybe we can enhance this functionality by using columnIndexes\n    return prepareStatement(sql);\n  }\n\n  @Override\n  public PreparedStatement prepareStatement(String sql, String[] columnNames) throws SQLException {\n    // TODO: maybe we can enhance this functionality by using columnNames\n    return prepareStatement(sql);\n  }\n\n  @Override\n  public Clob createClob() throws SQLException {\n    throw new SQLFeatureNotSupportedException(\"createClob not supported\");\n  }\n\n  @Override\n  public Blob createBlob() throws SQLException {\n    throw new SQLFeatureNotSupportedException(\"createBlob not supported\");\n  }\n\n  @Override\n  public NClob createNClob() throws SQLException {\n    throw new SQLFeatureNotSupportedException(\"createNClob not supported\");\n  }\n\n  @Override\n  @SkipNullableCheck\n  public SQLXML createSQLXML() throws SQLException {\n    throw new SQLFeatureNotSupportedException(\"createSQLXML not supported\");\n  }\n","sourceCodeStart":250,"sourceCodeEnd":286,"githubUrl":"https://github.com/tursodatabase/turso/blob/244cde92a7df7f9b8b8b7a4075c35a12977e303e/bindings/java/src/main/java/tech/turso/jdbc4/JDBC4Connection.java#L250-L286","documentation":"Connection.createClob() throws SQLFeatureNotSupportedException at JDBC4Connection.java:268: the driver does not implement client-side Clob value objects. Bind text directly with PreparedStatement.setString() - turso/SQLite stores TEXT natively and needs no Clob intermediary. The exception is a SQLException subclass, so it also surfaces through generic SQLException handlers.","triggerScenarios":"conn.createClob() followed by clob.setString(...) and setClob(i, clob); JPA/Hibernate entity attributes typed java.sql.Clob or @Lob on String in LOB-locating modes; generic DAL utilities that always wrap large text in Clob; framework DDL/inspection code that creates Clobs for metadata round-trips.","commonSituations":"Hibernate mappings using ClobType / MaterializedClob on entity fields; code migrated from Oracle where Clob is the default large-text vehicle; streaming large documents through JDBC LOB APIs; libraries like Apache Commons DbUtils or Spring's LOB handlers that call createClob.","solutions":["Replace createClob + setClob with a direct ps.setString(index, text).","Change entity attribute types from java.sql.Clob to String (map the column to TEXT).","In Hibernate, use a dialect/configuration that materializes LOBs as String/byte[] rather than java.sql.Clob.","Catch SQLFeatureNotSupportedException in generic framework adapters and fall back to setString."],"exampleFix":"// before\nClob clob = conn.createClob(); // throws\nclob.setString(1, bigText);\nps.setClob(2, clob);\n\n// after\nps.setString(2, bigText);","handlingStrategy":"fallback","validationCode":"// bind text directly; no Clob object needed\n// ps.setString(index, largeText) always works for TEXT columns","typeGuard":null,"tryCatchPattern":"try {\n    Clob clob = conn.createClob();\n    ps.setClob(i, clob);\n} catch (SQLFeatureNotSupportedException e) {\n    ps.setString(i, largeText); // fallback binding\n}","preventionTips":["Map large text to String + TEXT columns in JPA entities.","Avoid java.sql.Clob-typed attributes in entity models.","Audit ORM LOB handling to materialize strings, not Clob objects.","Follow driver docs rather than generic JDBC LOB tutorials."],"tags":["java","jdbc","turso","lob","clob"],"backgroundTag":"jdbc-lob-unsupported","analyzedSha":"244cde92a7df7f9b8b8b7a4075c35a12977e303e","analyzedAt":"2026-08-20T07:02:18.389Z","contentChangedAt":"2026-08-20T07:02:18.389Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}