{"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":"warning","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/bad083fafbefdeae9a42ec19bdaaad8918dcf411/bindings/java/src/main/java/tech/turso/jdbc4/JDBC4Connection.java#L250-L286","documentation":"Connection.createClob() unconditionally throws SQLFeatureNotSupportedException. The driver does not implement client-side LOB objects; text is passed as plain Java String values through the text bind path, so there is never a need for a Clob intermediary on this engine.","triggerScenarios":"Direct conn.createClob() calls; JPA/Hibernate materializing @Lob String attributes into Clobs; generic JDBC code ported from tutorials that demonstrate Clob usage; frameworks preparing Clob for setCharacterStream flows.","commonSituations":"Hibernate mapping @Lob on String fields; document/article storage code written against PostgreSQL/Oracle; copy-pasted JDBC LOB examples; migration of code that stores large text via Clob objects.","solutions":["Bind the text directly with setString/ps.bindText; SQLite-style TEXT columns take unbounded strings.","For Hibernate @Lob String fields, use a materialized String mapping (e.g., @Lob with String type or a custom UserType that reads/writes strings).","Replace setClob(i, clob) flows with setString(i, clobText).","Remove createClob calls from utility code; there is no flag to enable them."],"exampleFix":"// before\nClob clob = conn.createClob(); // throws\nclob.setString(1, articleBody);\nps.setClob(2, clob);\n\n// after\nps.setString(2, articleBody); // TEXT column, no Clob object needed","handlingStrategy":"fallback","validationCode":"if (conn.getMetaData().supportsStoredFunctionsUsingCallSyntax() /* proxy check */ || true) {\n    // simplest: never build Clobs; bind the string directly\n    ps.setString(parameterIndex, text);\n}","typeGuard":null,"tryCatchPattern":"try {\n    Clob clob = conn.createClob();\n    clob.setString(1, text);\n    ps.setClob(i, clob);\n} catch (SQLFeatureNotSupportedException e) {\n    ps.setString(i, text); // fallback: bind the raw string\n}","preventionTips":["Default to setString for all large text; add Clob paths only when a driver requires them.","For Hibernate @Lob String fields, verify materialization as plain strings against the actual dialect.","Keep driver-specific LOB handling behind one interface so fallbacks are centralized.","Test LOB flows against the real driver in integration tests, not just JDBC interfaces."],"tags":["java","jdbc","clob","lob","large-objects","unsupported-feature","hibernate"],"backgroundTag":"lob-not-supported","analyzedSha":"bad083fafbefdeae9a42ec19bdaaad8918dcf411","analyzedAt":"2026-08-16T23:12:11.798Z","schemaVersion":2},"datasetVersion":"2026-08-17T04:17:16.089Z"}