{"record":{"id":"a3a5e0603e0339df","repo":"prestodb/presto","slug":"updatedate","errorCode":null,"errorMessage":"updateDate","messagePattern":"updateDate","errorType":"exception","errorClass":"SQLFeatureNotSupportedException","httpStatus":null,"severity":"error","filePath":"presto-jdbc/src/main/java/com/facebook/presto/jdbc/PrestoResultSet.java","lineNumber":851,"sourceCode":"    @Override\n    public void updateString(int columnIndex, String x)\n            throws SQLException\n    {\n        throw new SQLFeatureNotSupportedException(\"updateString\");\n    }\n\n    @Override\n    public void updateBytes(int columnIndex, byte[] x)\n            throws SQLException\n    {\n        throw new SQLFeatureNotSupportedException(\"updateBytes\");\n    }\n\n    @Override\n    public void updateDate(int columnIndex, Date x)\n            throws SQLException\n    {\n        throw new SQLFeatureNotSupportedException(\"updateDate\");\n    }\n\n    @Override\n    public void updateTime(int columnIndex, Time x)\n            throws SQLException\n    {\n        throw new SQLFeatureNotSupportedException(\"updateTime\");\n    }\n\n    @Override\n    public void updateTimestamp(int columnIndex, Timestamp x)\n            throws SQLException\n    {\n        throw new SQLFeatureNotSupportedException(\"updateTimestamp\");\n    }\n\n    @Override\n    public void updateAsciiStream(int columnIndex, InputStream x, int length)","sourceCodeStart":833,"sourceCodeEnd":869,"githubUrl":"https://github.com/prestodb/presto/blob/55bb57d202de3b926896fa966c2c4a44c779634e/presto-jdbc/src/main/java/com/facebook/presto/jdbc/PrestoResultSet.java#L833-L869","documentation":"PrestoResultSet.updateDate(int, java.sql.Date) unconditionally throws SQLFeatureNotSupportedException(\"updateDate\"). Presto result sets are read-only; every ResultSet updateXxx method in the driver is a stub that rejects the call rather than buffering an in-row change. DATE columns cannot be edited through the cursor.","triggerScenarios":"Calling updateDate(columnIndex, date) or updateDate(columnLabel, date) on a PrestoResultSet, typically followed by updateRow(), when trying to modify a DATE column in a fetched row.","commonSituations":"Legacy data-correction scripts written for Oracle/MySQL ported to Presto; batch jobs that shift dates row by row via the cursor; ORM updatable-result-set support enabled against Presto.","solutions":["Run an explicit UPDATE statement (PreparedStatement.setDate) instead of a cursor update.","Use a set-based UPDATE for many rows, e.g. UPDATE t SET d = DATE_ADD('day', 1, d) WHERE ...","Declare CONCUR_READ_ONLY so accidental update code paths are not relied upon.","Configure the ORM/driver layer to mark the Presto catalog read-only."],"exampleFix":"// before\nrs.updateDate(\"due_date\", newDue);\nrs.updateRow();\n// after\ntry (PreparedStatement ps = conn.prepareStatement(\"UPDATE tasks SET due_date = ? WHERE id = ?\")) {\n    ps.setDate(1, newDue);\n    ps.setLong(2, id);\n    ps.executeUpdate();\n}","handlingStrategy":"try-catch","validationCode":"if (rs instanceof com.facebook.presto.jdbc.PrestoResultSet) {\n    // use PreparedStatement.setDate + executeUpdate instead of updateDate\n}","typeGuard":"boolean supportsCursorUpdate(ResultSet rs) {\n    return !(rs instanceof com.facebook.presto.jdbc.PrestoResultSet);\n}","tryCatchPattern":"try {\n    rs.updateDate(\"due_date\", newDue);\n    rs.updateRow();\n} catch (SQLFeatureNotSupportedException e) {\n    // run UPDATE tasks SET due_date = ? WHERE id = ?\n}","preventionTips":["Use set-based date arithmetic in SQL for bulk date changes.","Create Presto statements with CONCUR_READ_ONLY.","Refactor legacy data-fix scripts to UPDATE statements when porting to Presto.","Document the read-only nature of Presto result sets in team guidelines."],"tags":["jdbc","sqlfeaturenotsupportedexception","read-only-resultset","presto"],"backgroundTag":"jdbc-updatable-resultset-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"}