{"record":{"id":"6fb801bbe366523e","repo":"prestodb/presto","slug":"createblob","errorCode":null,"errorMessage":"createBlob","messagePattern":"createBlob","errorType":"exception","errorClass":"SQLFeatureNotSupportedException","httpStatus":null,"severity":"error","filePath":"presto-jdbc/src/main/java/com/facebook/presto/jdbc/PrestoConnection.java","lineNumber":512,"sourceCode":"    @Override\n    public PreparedStatement prepareStatement(String sql, String[] columnNames)\n            throws SQLException\n    {\n        throw new SQLFeatureNotSupportedException(\"prepareStatement\");\n    }\n\n    @Override\n    public Clob createClob()\n            throws SQLException\n    {\n        throw new SQLFeatureNotSupportedException(\"createClob\");\n    }\n\n    @Override\n    public Blob createBlob()\n            throws SQLException\n    {\n        throw new SQLFeatureNotSupportedException(\"createBlob\");\n    }\n\n    @Override\n    public NClob createNClob()\n            throws SQLException\n    {\n        throw new SQLFeatureNotSupportedException(\"createNClob\");\n    }\n\n    @Override\n    public SQLXML createSQLXML()\n            throws SQLException\n    {\n        throw new SQLFeatureNotSupportedException(\"createSQLXML\");\n    }\n\n    @Override\n    public boolean isValid(int timeout)","sourceCodeStart":494,"sourceCodeEnd":530,"githubUrl":"https://github.com/prestodb/presto/blob/55bb57d202de3b926896fa966c2c4a44c779634e/presto-jdbc/src/main/java/com/facebook/presto/jdbc/PrestoConnection.java#L494-L530","documentation":"PrestoConnection.createBlob() unconditionally throws SQLFeatureNotSupportedException(\"createBlob\"). The driver does not implement JDBC Blob creation; there is no server round trip and the call always fails. Binary data must be sent with regular binary APIs instead.","triggerScenarios":"Calling connection.createBlob(), or frameworks that wrap byte[]/InputStream payloads in a Blob for PreparedStatement.setBlob.","commonSituations":"Porting code from drivers with Blob support; ORMs mapping Types.BLOB columns; ETL pipelines writing VARBINARY via generic Blob helpers.","solutions":["Bind binary data directly with setBytes/setBinaryStream for VARBINARY columns","Remove Blob wrappers from the data path and pass byte[] or InputStream","Add a driver capability check so Blob paths fall back to plain binary binding"],"exampleFix":"// before\nBlob blob = connection.createBlob();\nblob.setBytes(1, data);\nps.setBlob(1, blob);\n// after\nps.setBytes(1, data);","handlingStrategy":"try-catch","validationCode":"DatabaseMetaData meta = connection.getMetaData();\nif (meta.getDriverName().contains(\"Presto\")) {\n    // driver does not support createBlob — use byte[]/stream binding\n}","typeGuard":"static boolean supportsClientBlob(DatabaseMetaData meta) throws SQLException {\n    return !meta.getDriverName().contains(\"Presto\");\n}","tryCatchPattern":"try {\n    Blob blob = connection.createBlob();\n    // ... use blob\n} catch (SQLFeatureNotSupportedException e) {\n    // fall back: ps.setBytes(...) / ps.setBinaryStream(...)\n}","preventionTips":["Bind VARBINARY data with setBytes/setBinaryStream instead of Blob objects","Avoid Blob wrappers in shared data-binding utilities","Test binary round trips (write+read) against Presto in CI"],"tags":["jdbc","presto","unsupported-operation","blob"],"backgroundTag":"sql-feature-not-supported","analyzedSha":"55bb57d202de3b926896fa966c2c4a44c779634e","analyzedAt":"2026-09-04T12:50:26.162Z","contentChangedAt":"2026-09-04T12:50:26.162Z","schemaVersion":2},"datasetVersion":"2026-09-11T21:17:09.523Z"}