{"record":{"id":"85cf560e9ea47102","repo":"prestodb/presto","slug":"updaterow","errorCode":null,"errorMessage":"updateRow","messagePattern":"updateRow","errorType":"exception","errorClass":"SQLFeatureNotSupportedException","httpStatus":null,"severity":"error","filePath":"presto-jdbc/src/main/java/com/facebook/presto/jdbc/PrestoResultSet.java","lineNumber":1047,"sourceCode":"    @Override\n    public void updateObject(String columnLabel, Object x)\n            throws SQLException\n    {\n        throw new SQLFeatureNotSupportedException(\"updateObject\");\n    }\n\n    @Override\n    public void insertRow()\n            throws SQLException\n    {\n        throw new SQLFeatureNotSupportedException(\"insertRow\");\n    }\n\n    @Override\n    public void updateRow()\n            throws SQLException\n    {\n        throw new SQLFeatureNotSupportedException(\"updateRow\");\n    }\n\n    @Override\n    public void deleteRow()\n            throws SQLException\n    {\n        throw new SQLFeatureNotSupportedException(\"deleteRow\");\n    }\n\n    @Override\n    public void refreshRow()\n            throws SQLException\n    {\n        throw new SQLFeatureNotSupportedException(\"refreshRow\");\n    }\n\n    @Override\n    public void cancelRowUpdates()","sourceCodeStart":1029,"sourceCodeEnd":1065,"githubUrl":"https://github.com/prestodb/presto/blob/55bb57d202de3b926896fa966c2c4a44c779634e/presto-jdbc/src/main/java/com/facebook/presto/jdbc/PrestoResultSet.java#L1029-L1065","documentation":"updateRow() belongs to JDBC's updatable result set API. Presto's PrestoResultSet is read-only, so the method always throws SQLFeatureNotSupportedException(\"updateRow\"). Changes to result data must be issued as SQL UPDATE statements, not cursor updates.","triggerScenarios":"Calling updateRow() after using updateXxx(column, value) on a PrestoResultSet to flush cursor-based modifications to the database.","commonSituations":"Migrating code from updatable-result-set databases (e.g. PostgreSQL) to Presto; frameworks that issue SELECT FOR UPDATE-style flows; batch update loops written against ResultSet.updateRow().","solutions":["Replace ResultSet.updateXxx()+updateRow() with a PreparedStatement executing UPDATE ... WHERE key = ?","Verify concurrency with resultSet.getConcurrency(); treat CONCUR_READ_ONLY as a signal to use SQL-based updates","Restructure the application to treat Presto strictly as a query engine for reads"],"exampleFix":"// before\nrs.absolute(row);\nrs.updateInt(\"qty\", 5);\nrs.updateRow();\n// after\ntry (PreparedStatement ps = conn.prepareStatement(\n        \"UPDATE orders SET qty = ? WHERE id = ?\")) {\n    ps.setInt(1, 5);\n    ps.setLong(2, orderId);\n    ps.executeUpdate();\n}","handlingStrategy":"try-catch","validationCode":"if (rs.getConcurrency() == ResultSet.CONCUR_READ_ONLY) {\n    // use SQL UPDATE via PreparedStatement instead\n}","typeGuard":"static boolean supportsUpdateRow(ResultSet rs) {\n    try {\n        return rs.getConcurrency() == ResultSet.CONCUR_UPDATABLE;\n    } catch (SQLException e) {\n        return false;\n    }\n}","tryCatchPattern":"try {\n    rs.updateRow();\n} catch (SQLFeatureNotSupportedException e) {\n    // flush via SQL UPDATE instead\n}","preventionTips":["Never mix updateXxx()/updateRow() cursor updates with Presto reads","Issue SQL UPDATE statements for data changes","Audit ported JDBC code for cursor-update calls before targeting Presto"],"tags":["jdbc","presto","unsupported-feature","sqlfeaturenotsupported"],"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"}