{"record":{"id":"4487647b5459ace7","repo":"prestodb/presto","slug":"updateref","errorCode":null,"errorMessage":"updateRef","messagePattern":"updateRef","errorType":"exception","errorClass":"SQLFeatureNotSupportedException","httpStatus":null,"severity":"error","filePath":"presto-jdbc/src/main/java/com/facebook/presto/jdbc/PrestoResultSet.java","lineNumber":1229,"sourceCode":"    @Override\n    public URL getURL(int columnIndex)\n            throws SQLException\n    {\n        throw new SQLFeatureNotSupportedException(\"getURL\");\n    }\n\n    @Override\n    public URL getURL(String columnLabel)\n            throws SQLException\n    {\n        throw new SQLFeatureNotSupportedException(\"getURL\");\n    }\n\n    @Override\n    public void updateRef(int columnIndex, Ref x)\n            throws SQLException\n    {\n        throw new SQLFeatureNotSupportedException(\"updateRef\");\n    }\n\n    @Override\n    public void updateRef(String columnLabel, Ref x)\n            throws SQLException\n    {\n        throw new SQLFeatureNotSupportedException(\"updateRef\");\n    }\n\n    @Override\n    public void updateBlob(int columnIndex, Blob x)\n            throws SQLException\n    {\n        throw new SQLFeatureNotSupportedException(\"updateBlob\");\n    }\n\n    @Override\n    public void updateBlob(String columnLabel, Blob x)","sourceCodeStart":1211,"sourceCodeEnd":1247,"githubUrl":"https://github.com/prestodb/presto/blob/55bb57d202de3b926896fa966c2c4a44c779634e/presto-jdbc/src/main/java/com/facebook/presto/jdbc/PrestoResultSet.java#L1211-L1247","documentation":"Presto result sets are forward-only, read-only; no update* method is implemented. updateRef(int, Ref) always throws SQLFeatureNotSupportedException(\"updateRef\") — the driver never supports positioned updates or REF types.","triggerScenarios":"Calling rs.updateRef(columnIndex, ref) on an updatable-ResultSet code path with a PrestoResultSet.","commonSituations":"Code ported from desktop-style JDBC apps (e.g. Derby/Oracle updatable result sets); frameworks that attempt row updates through ResultSet.","solutions":["Do not update via ResultSet — issue an explicit UPDATE statement through Statement/PreparedStatement","Refactor the data-access layer so result sets are read-only","If REF semantics were used, model the relationship with plain columns"],"exampleFix":"// before\nrs.updateRef(1, ref);\nrs.updateRow();\n// after\ntry (PreparedStatement ps = conn.prepareStatement(\"UPDATE t SET ref_col = ? WHERE id = ?\")) {\n    ps.setString(1, refValue);\n    ps.setLong(2, id);\n    ps.executeUpdate();\n}","handlingStrategy":"validation","validationCode":"DatabaseMetaData md = conn.getMetaData();\nif (!md.supportsResultSetConcurrency(ResultSet.TYPE_FORWARD_ONLY, ResultSet.CONCUR_UPDATABLE)) { /* use UPDATE statements */ }","typeGuard":null,"tryCatchPattern":"try {\n    rs.updateRef(columnIndex, ref);\n} catch (SQLFeatureNotSupportedException e) {\n    // fall back to PreparedStatement UPDATE\n}","preventionTips":["Treat Presto ResultSets as forward-only, read-only always","Perform all writes via SQL statements","Check supportsResultSetConcurrency before using update* methods"],"tags":["jdbc","unsupported-feature","read-only-resultset"],"backgroundTag":"unsupported-jdbc-feature","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"}