tursodatabase/turso · warning · SQLFeatureNotSupportedException
createBlob not supported
Error message
createBlob not supported
What it means
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.
Source
Thrown at bindings/java/src/main/java/tech/turso/jdbc4/JDBC4Connection.java:273
public PreparedStatement prepareStatement(String sql, int[] columnIndexes) throws SQLException {
// TODO: maybe we can enhance this functionality by using columnIndexes
return prepareStatement(sql);
}
@Override
public PreparedStatement prepareStatement(String sql, String[] columnNames) throws SQLException {
// TODO: maybe we can enhance this functionality by using columnNames
return prepareStatement(sql);
}
@Override
public Clob createClob() throws SQLException {
throw new SQLFeatureNotSupportedException("createClob not supported");
}
@Override
public Blob createBlob() throws SQLException {
throw new SQLFeatureNotSupportedException("createBlob not supported");
}
@Override
public NClob createNClob() throws SQLException {
throw new SQLFeatureNotSupportedException("createNClob not supported");
}
@Override
@SkipNullableCheck
public SQLXML createSQLXML() throws SQLException {
throw new SQLFeatureNotSupportedException("createSQLXML not supported");
}
@Override
public boolean isValid(int timeout) throws SQLException {
if (isClosed()) {
return false;
}View on GitHub (pinned to bad083fafb)
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.
Example fix
// before Blob blob = conn.createBlob(); // throws blob.setBytes(1, imageData); ps.setBlob(2, blob); // after ps.setBytes(2, imageData); // BLOB column bound directly
Defensive patterns
Strategy: fallback
Validate before calling
// binary data needs no Blob object on this driver; bind bytes directly ps.setBytes(parameterIndex, bytes);
Try / catch
try {
Blob blob = conn.createBlob();
blob.setBytes(1, bytes);
ps.setBlob(i, blob);
} catch (SQLFeatureNotSupportedException e) {
ps.setBytes(i, bytes); // fallback: bind the raw byte[]
} Prevention
- 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.
When it happens
Trigger: 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.
Common situations: 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.
Related errors
- createClob not supported
- createNClob not supported
- createSQLXML not supported
- Exception while binding blob value at position " + position
- turso only supports CLOSE_CURSORS_AT_COMMIT
AI-assisted analysis of tursodatabase/turso@bad083fafb (2026-08-16).
Data as JSON: /api/errors/8bfe38a186136b76.
Report an issue: GitHub.