{"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":"error","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/244cde92a7df7f9b8b8b7a4075c35a12977e303e/bindings/java/src/main/java/tech/turso/jdbc4/JDBC4Connection.java#L255-L291","documentation":"Connection.createBlob() throws SQLFeatureNotSupportedException at JDBC4Connection.java:273 - the driver never hands out client-side Blob objects. Binary data is bound with setBytes() and stored in SQLite BLOB columns directly. Any framework that materializes binary values as java.sql.Blob will trip this immediately on connection use.","triggerScenarios":"conn.createBlob() + blob.setBytes(...) + ps.setBlob(...); JPA/Hibernate attributes typed java.sql.Blob; Spring's LobHandler/DefaultLobHandler createBlob path; generic file-upload code that wraps byte arrays in Blobs before insert.","commonSituations":"Hibernate entity fields declared as java.sql.Blob (BlobType); migrations from Oracle/DB2 where Blob wrapping is standard; media/document storage code that follows JDBC LOB tutorials; test fixtures that build Blobs programmatically.","solutions":["Replace Blob creation with ps.setBytes(index, byteArray).","Change entity attribute types from java.sql.Blob to byte[].","For very large values, use setBinaryStream(index, inputStream) instead of Blob wrapping.","Configure ORM LOB handling to materialize byte arrays rather than java.sql.Blob."],"exampleFix":"// before\nBlob blob = conn.createBlob(); // throws\nblob.setBytes(1, data);\nps.setBlob(1, blob);\n\n// after\nps.setBytes(1, data);","handlingStrategy":"fallback","validationCode":"// bind binary data directly; no Blob object needed\n// ps.setBytes(index, data) or ps.setBinaryStream(index, in) for large values","typeGuard":null,"tryCatchPattern":"try {\n    Blob blob = conn.createBlob();\n    ps.setBlob(i, blob);\n} catch (SQLFeatureNotSupportedException e) {\n    ps.setBytes(i, data); // fallback binding\n}","preventionTips":["Use byte[] entity attributes instead of java.sql.Blob.","Prefer setBinaryStream for very large binaries.","Disable framework LOB wrapping (e.g., Spring LOB helpers) for turso.","Test binary insert paths early when adopting the driver."],"tags":["java","jdbc","turso","lob","blob"],"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"}