{"record":{"id":"99cf9cf7ac016aba","repo":"prestodb/presto","slug":"setref","errorCode":null,"errorMessage":"setRef","messagePattern":"setRef","errorType":"exception","errorClass":"SQLFeatureNotSupportedException","httpStatus":null,"severity":"error","filePath":"presto-jdbc/src/main/java/com/facebook/presto/jdbc/PrestoPreparedStatement.java","lineNumber":489,"sourceCode":"            return batchUpdateCounts;\n        }\n        finally {\n            clearBatch();\n        }\n    }\n\n    @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)","sourceCodeStart":471,"sourceCodeEnd":507,"githubUrl":"https://github.com/prestodb/presto/blob/55bb57d202de3b926896fa966c2c4a44c779634e/presto-jdbc/src/main/java/com/facebook/presto/jdbc/PrestoPreparedStatement.java#L471-L507","documentation":"setRef is unconditionally unsupported in PrestoPreparedStatement: any call throws SQLFeatureNotSupportedException. Presto has no SQL REF type or locator-based reference support, so the driver rejects the JDBC interface method regardless of arguments.","triggerScenarios":"Calling PreparedStatement.setRef(int, Ref) on a Presto connection.","commonSituations":"Legacy code ported from Oracle/DB2 that uses REF CURSOR types.","solutions":["Remove the REF usage; Presto has no ref-cursor parameters.","Model the data with regular query results / result sets instead.","Bind a supported type (e.g. the referenced value itself) via setString/setLong."],"exampleFix":"// before\nps.setRef(1, ref);\n// after\nps.setString(1, referencedValue);","handlingStrategy":"validation","validationCode":"if (x instanceof java.sql.Ref) throw new IllegalArgumentException(\"Presto JDBC does not support Ref parameters\");","typeGuard":"static boolean isRefParam(Object x) { return x instanceof java.sql.Ref; }","tryCatchPattern":"try { ps.setRef(1, ref); } catch (SQLFeatureNotSupportedException e) { /* rewrite binding with a supported type */ }","preventionTips":["Avoid JDBC REF types when targeting Presto","Model cursor-like logic with explicit query result sets","Keep a compatibility matrix of supported setter types for the driver"],"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"}