{"record":{"id":"54757829b23239a2","repo":"prestodb/presto","slug":"setblob","errorCode":null,"errorMessage":"setBlob","messagePattern":"setBlob","errorType":"exception","errorClass":"SQLFeatureNotSupportedException","httpStatus":null,"severity":"error","filePath":"presto-jdbc/src/main/java/com/facebook/presto/jdbc/PrestoPreparedStatement.java","lineNumber":496,"sourceCode":"    @Override\n    public void setCharacterStream(int parameterIndex, Reader reader, int length)\n            throws SQLException\n    {\n        throw new NotImplementedException(\"PreparedStatement\", \"setCharacterStream\");\n    }\n\n    @Override\n    public void setRef(int parameterIndex, Ref x)\n            throws SQLException\n    {\n        throw new SQLFeatureNotSupportedException(\"setRef\");\n    }\n\n    @Override\n    public void setBlob(int parameterIndex, Blob x)\n            throws SQLException\n    {\n        throw new SQLFeatureNotSupportedException(\"setBlob\");\n    }\n\n    @Override\n    public void setClob(int parameterIndex, Clob x)\n            throws SQLException\n    {\n        throw new SQLFeatureNotSupportedException(\"setClob\");\n    }\n\n    @Override\n    public void setArray(int parameterIndex, Array x)\n            throws SQLException\n    {\n        throw new SQLFeatureNotSupportedException(\"setArray\");\n    }\n\n    @Override\n    public ResultSetMetaData getMetaData()","sourceCodeStart":478,"sourceCodeEnd":514,"githubUrl":"https://github.com/prestodb/presto/blob/55bb57d202de3b926896fa966c2c4a44c779634e/presto-jdbc/src/main/java/com/facebook/presto/jdbc/PrestoPreparedStatement.java#L478-L514","documentation":"setBlob is unconditionally unsupported in PrestoPreparedStatement: any call throws SQLFeatureNotSupportedException because the driver has no BLOB locator support. Binary data must be bound with setBytes instead of a java.sql.Blob handle.","triggerScenarios":"Calling PreparedStatement.setBlob(int, Blob) on a Presto connection.","commonSituations":"Inserting binary data (images, files) ported from other databases' JDBC drivers.","solutions":["Extract byte[] via blob.getBytes(1, (int) blob.length()) and call setBytes.","Bind binary data as varbinary using setBytes instead of Blob.","Store large binaries externally and insert a reference/URL string."],"exampleFix":"// before\nps.setBlob(1, blob);\n// after\nps.setBytes(1, blob.getBytes(1, (int) blob.length()));","handlingStrategy":"fallback","validationCode":"if (x instanceof java.sql.Blob) { byte[] bytes = x.getBytes(1, (int) x.length()); ps.setBytes(1, bytes); return; }","typeGuard":null,"tryCatchPattern":"try { ps.setBlob(1, blob); } catch (SQLFeatureNotSupportedException e) { ps.setBytes(1, blob.getBytes(1, (int) blob.length())); }","preventionTips":["Bind binary data with setBytes(varbinary)","Store large binaries outside Presto and reference by URL/path","Avoid java.sql.Blob in Presto-targeting data-access code"],"tags":["jdbc","presto","unsupported-feature"],"backgroundTag":"jdbc-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"}