{"record":{"id":"529a749700983a92","repo":"prestodb/presto","slug":"updateshort","errorCode":null,"errorMessage":"updateShort","messagePattern":"updateShort","errorType":"exception","errorClass":"SQLFeatureNotSupportedException","httpStatus":null,"severity":"error","filePath":"presto-jdbc/src/main/java/com/facebook/presto/jdbc/PrestoResultSet.java","lineNumber":795,"sourceCode":"    @Override\n    public void updateBoolean(int columnIndex, boolean x)\n            throws SQLException\n    {\n        throw new SQLFeatureNotSupportedException(\"updateBoolean\");\n    }\n\n    @Override\n    public void updateByte(int columnIndex, byte x)\n            throws SQLException\n    {\n        throw new SQLFeatureNotSupportedException(\"updateByte\");\n    }\n\n    @Override\n    public void updateShort(int columnIndex, short x)\n            throws SQLException\n    {\n        throw new SQLFeatureNotSupportedException(\"updateShort\");\n    }\n\n    @Override\n    public void updateInt(int columnIndex, int x)\n            throws SQLException\n    {\n        throw new SQLFeatureNotSupportedException(\"updateInt\");\n    }\n\n    @Override\n    public void updateLong(int columnIndex, long x)\n            throws SQLException\n    {\n        throw new SQLFeatureNotSupportedException(\"updateLong\");\n    }\n\n    @Override\n    public void updateFloat(int columnIndex, float x)","sourceCodeStart":777,"sourceCodeEnd":813,"githubUrl":"https://github.com/prestodb/presto/blob/55bb57d202de3b926896fa966c2c4a44c779634e/presto-jdbc/src/main/java/com/facebook/presto/jdbc/PrestoResultSet.java#L777-L813","documentation":"PrestoResultSet.updateShort(columnIndex, x) is an unimplemented stub that always throws SQLFeatureNotSupportedException. Presto result sets are read-only snapshots; the driver provides no mechanism for in-place updates. Any updateXxx call fails immediately regardless of the statement that produced the result set.","triggerScenarios":"Calling rs.updateShort(i, value) on a Presto ResultSet, typically before updateRow().","commonSituations":"Portable JDBC persistence layers using updatable result sets; code migrated from MySQL/PostgreSQL to Presto without removing ResultSet write calls.","solutions":["Replace with a PreparedStatement issuing UPDATE table SET col = ? WHERE ...","Restructure the workflow to read, compute in Java, then write via SQL","Create read-only statements and never attempt positioned updates on Presto","Catch SQLFeatureNotSupportedException as a signal to fall back to SQL-based writes"],"exampleFix":"// before\nrs.updateShort(\"qty\", (short) 5);\nrs.updateRow();\n// after\ntry (PreparedStatement ps = conn.prepareStatement(\"UPDATE t SET qty = ? WHERE id = ?\")) {\n    ps.setShort(1, (short) 5);\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)) {\n    // use PreparedStatement UPDATE instead of rs.updateShort\n}","typeGuard":"boolean isUpdatable(ResultSet rs) throws SQLException {\n    return rs.getConcurrency() == ResultSet.CONCUR_UPDATABLE;\n}","tryCatchPattern":"try {\n    rs.updateShort(columnIndex, value);\n} catch (SQLFeatureNotSupportedException e) {\n    // route to SQL UPDATE fallback\n}","preventionTips":["Do not use ResultSet-based editing workflows with Presto","Write values via PreparedStatement.executeUpdate","Check statement concurrency before iterating rows","Centralize writes in a data-access layer that emits DML"],"tags":["jdbc","unsupported-feature","updatable-resultset","sqlfeaturenotsupportedexception"],"backgroundTag":"sqlfeaturenotsupported-unsupported-jdbc-method","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"}