{"record":{"id":"8bfe38a186136b76","repo":"tursodatabase/turso","slug":"createblob-not-supported","errorCode":null,"errorMessage":"createBlob not supported","messagePattern":"createBlob not supported","errorType":"exception","errorClass":"SQLFeatureNotSupportedException","httpStatus":null,"severity":"warning","filePath":"bindings/java/src/main/java/tech/turso/jdbc4/JDBC4Connection.java","lineNumber":273,"sourceCode":"  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\n  @Override\n  public boolean isValid(int timeout) throws SQLException {\n    if (isClosed()) {\n      return false;\n    }","sourceCodeStart":255,"sourceCodeEnd":291,"githubUrl":"https://github.com/tursodatabase/turso/blob/bad083fafbefdeae9a42ec19bdaaad8918dcf411/bindings/java/src/main/java/tech/turso/jdbc4/JDBC4Connection.java#L255-L291","documentation":"Connection.createBlob() unconditionally throws SQLFeatureNotSupportedException. The driver has no client-side Blob implementation; binary data is bound directly as byte[] through the blob bind path, so Blob objects are neither created nor needed.","triggerScenarios":"Direct conn.createBlob() calls; Hibernate/JPA materializing @Lob byte[] attributes into Blobs; binary upload code written against other drivers; framework code that wraps byte[] in a Blob before setBlob.","commonSituations":"File/image storage code ported from PostgreSQL/Oracle; Hibernate entities with @Lob byte[] fields; code following JDBC LOB tutorials; migration projects where setBlob(Blob) is the established pattern.","solutions":["Bind the raw byte[] with setBytes/ps.bindBlob.","For Hibernate @Lob byte[] fields, map as materialized binary (@Lob on byte[] with a UserType that binds bytes directly).","Replace setBlob(i, blob) flows with setBytes(i, bytes).","Delete createBlob calls; no configuration enables them."],"exampleFix":"// before\nBlob blob = conn.createBlob(); // throws\nblob.setBytes(1, imageData);\nps.setBlob(2, blob);\n\n// after\nps.setBytes(2, imageData); // BLOB column bound directly","handlingStrategy":"fallback","validationCode":"// binary data needs no Blob object on this driver; bind bytes directly\nps.setBytes(parameterIndex, bytes);","typeGuard":null,"tryCatchPattern":"try {\n    Blob blob = conn.createBlob();\n    blob.setBytes(1, bytes);\n    ps.setBlob(i, blob);\n} catch (SQLFeatureNotSupportedException e) {\n    ps.setBytes(i, bytes); // fallback: bind the raw byte[]\n}","preventionTips":["Make setBytes the default path for binary columns; wrap in Blob only when the driver demands it.","For Hibernate @Lob byte[] attributes, confirm the dialect materializes byte[] directly.","Centralize binary bind logic in one helper with a createBlob fallback branch.","Integration-test file upload paths against the target driver before release."],"tags":["java","jdbc","blob","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"}