{"record":{"id":"2030d3e9dc38ef8b","repo":"tursodatabase/turso","slug":"createnclob-not-supported","errorCode":null,"errorMessage":"createNClob not supported","messagePattern":"createNClob not supported","errorType":"exception","errorClass":"SQLFeatureNotSupportedException","httpStatus":null,"severity":"warning","filePath":"bindings/java/src/main/java/tech/turso/jdbc4/JDBC4Connection.java","lineNumber":278,"sourceCode":"  @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\n  @Override\n  public boolean isValid(int timeout) throws SQLException {\n    if (isClosed()) {\n      return false;\n    }\n\n    try (Statement statement = createStatement()) {\n      return statement.execute(\"select 1;\");\n    }\n  }","sourceCodeStart":260,"sourceCodeEnd":296,"githubUrl":"https://github.com/tursodatabase/turso/blob/bad083fafbefdeae9a42ec19bdaaad8918dcf411/bindings/java/src/main/java/tech/turso/jdbc4/JDBC4Connection.java#L260-L296","documentation":"Connection.createNClob() unconditionally throws SQLFeatureNotSupportedException. NClob models national-character-set text, a concept from big-database SQL dialects that a SQLite-compatible engine does not have; all text is UTF-8 and bound as ordinary String values.","triggerScenarios":"Direct conn.createNClob() calls; code ported from SQL Server/DB2 where NTEXT/NVARCHAR(max) require NClob; generic LOB utility methods that branch to createNClob for 'unicode' fields; ORM dialects mapping nationalized @Nationalized attributes.","commonSituations":"Migrating from SQL Server with nvarchar(max) columns; Hibernate @Nationalized annotations; enterprise codebases with unicode-handling helpers that create NClobs regardless of driver.","solutions":["Store the text as a normal TEXT column and bind with setString.","Remove Hibernate @Nationalized annotations for this datasource (plain String attributes work).","Replace setNClob flows with setString since all text is UTF-8 already.","Delete createNClob branches in shared utility code."],"exampleFix":"// before\nNClob nclob = conn.createNClob(); // throws\nnclob.setString(1, unicodeText);\nps.setNClob(2, nclob);\n\n// after\nps.setString(2, unicodeText); // TEXT is UTF-8; no national char type needed","handlingStrategy":"fallback","validationCode":"// no national char types on this engine; bind the string directly\nps.setString(parameterIndex, unicodeText);","typeGuard":null,"tryCatchPattern":"try {\n    NClob nclob = conn.createNClob();\n    nclob.setString(1, unicodeText);\n    ps.setNClob(i, nclob);\n} catch (SQLFeatureNotSupportedException e) {\n    ps.setString(i, unicodeText); // fallback: plain UTF-8 text\n}","preventionTips":["Treat all text as UTF-8; do not branch on nationalized types for this driver.","Remove Hibernate @Nationalized annotations when running against SQLite-compatible engines.","Avoid setNClob/createNClob in shared utility code or guard them with capability checks.","Document in the data-access layer that NCLOB is a no-op concept here."],"tags":["java","jdbc","nclob","lob","unicode","unsupported-feature"],"backgroundTag":"lob-not-supported","analyzedSha":"bad083fafbefdeae9a42ec19bdaaad8918dcf411","analyzedAt":"2026-08-16T23:12:11.798Z","schemaVersion":2},"datasetVersion":"2026-08-17T04:17:16.089Z"}