{"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":"error","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/244cde92a7df7f9b8b8b7a4075c35a12977e303e/bindings/java/src/main/java/tech/turso/jdbc4/JDBC4Connection.java#L260-L296","documentation":"Connection.createNClob() throws SQLFeatureNotSupportedException at JDBC4Connection.java:278. NClob is the national-character-set variant of Clob; the engine behind turso stores all text as UTF-8 and has no separate NCHAR LOB type, so the API is deliberately unimplemented. Use setString() for national character text as well.","triggerScenarios":"conn.createNClob() followed by setNClob(...); Hibernate/JPA with @Nationalized annotations on large text fields; frameworks that prefer NClob for NString-typed parameters (JPA nationalized support); code ported from SQL Server nvarchar(max) patterns.","commonSituations":"Hibernate @Nationalized + @Lob String attributes; migrations from SQL Server where nvarchar(max) maps to NClob; generic ORM parameter binders that choose NClob for unicode columns; conformance suites that exercise the full JDBC 4 surface.","solutions":["Use ps.setNString(index, text) or ps.setString(index, text) - both store UTF-8 text natively.","Remove @Nationalized/@Lob combos from Hibernate mappings and map to plain String over TEXT columns.","Catch SQLFeatureNotSupportedException in shared layers and fall back to setNString.","Remove all createNClob/setNClob(Clob) call sites; grep for 'NClob' during migrations."],"exampleFix":"// before\nNClob nclob = conn.createNClob(); // throws\nnclob.setString(1, unicodeText);\nps.setNClob(1, nclob);\n\n// after\nps.setNString(1, unicodeText);","handlingStrategy":"fallback","validationCode":"// unicode text binds directly; no NClob needed\n// ps.setNString(index, unicodeText) handles UTF-8 natively","typeGuard":null,"tryCatchPattern":"try {\n    NClob nclob = conn.createNClob();\n    ps.setNClob(i, nclob);\n} catch (SQLFeatureNotSupportedException e) {\n    ps.setNString(i, unicodeText); // fallback binding\n}","preventionTips":["Avoid @Nationalized + @Lob combinations in Hibernate mappings.","Use String over TEXT columns for unicode text.","Remove NClob wrapping when migrating from SQL Server nvarchar(max) patterns.","Grep for NClob during database migrations."],"tags":["java","jdbc","turso","lob","nclob","unicode"],"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"}