{"record":{"id":"4924e91ded39e483","repo":"prestodb/presto","slug":"updatestring","errorCode":null,"errorMessage":"updateString","messagePattern":"updateString","errorType":"exception","errorClass":"SQLFeatureNotSupportedException","httpStatus":null,"severity":"error","filePath":"presto-jdbc/src/main/java/com/facebook/presto/jdbc/PrestoResultSet.java","lineNumber":837,"sourceCode":"    @Override\n    public void updateDouble(int columnIndex, double x)\n            throws SQLException\n    {\n        throw new SQLFeatureNotSupportedException(\"updateDouble\");\n    }\n\n    @Override\n    public void updateBigDecimal(int columnIndex, BigDecimal x)\n            throws SQLException\n    {\n        throw new SQLFeatureNotSupportedException(\"updateBigDecimal\");\n    }\n\n    @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)","sourceCodeStart":819,"sourceCodeEnd":855,"githubUrl":"https://github.com/prestodb/presto/blob/55bb57d202de3b926896fa966c2c4a44c779634e/presto-jdbc/src/main/java/com/facebook/presto/jdbc/PrestoResultSet.java#L819-L855","documentation":"PrestoResultSet.updateString(int, String) unconditionally throws SQLFeatureNotSupportedException(\"updateString\"). The Presto JDBC driver ships read-only result sets; all ResultSet updateXxx methods are interface-compliance stubs that reject the call. Row data returned by a query cannot be modified through the cursor.","triggerScenarios":"Calling updateString(columnIndex, value) or updateString(columnLabel, value) on a ResultSet obtained from the Presto driver, usually in code that pairs updateString with updateRow() to edit a VARCHAR column in place.","commonSituations":"Migrating legacy JDBC CRUD code from a traditional RDBMS to Presto; data-fix scripts that walk a ResultSet and patch column values; report-generation code that mutates cells before persistence.","solutions":["Issue an explicit UPDATE statement (preferably PreparedStatement with parameters) instead of using updateString/updateRow.","Use CONCUR_READ_ONLY result sets and copy values into application objects if transformation is needed.","For bulk corrections, run a single UPDATE ... WHERE query rather than row-by-row cursor updates.","If an ORM triggers it, mark the Presto datasource as read-only in the ORM configuration."],"exampleFix":"// before\nrs.updateString(\"name\", newName);\nrs.updateRow();\n// after\ntry (PreparedStatement ps = conn.prepareStatement(\"UPDATE users SET name = ? WHERE id = ?\")) {\n    ps.setString(1, newName);\n    ps.setLong(2, id);\n    ps.executeUpdate();\n}","handlingStrategy":"try-catch","validationCode":"if (conn.getMetaData().allProceduresAreCallable() && rs instanceof com.facebook.presto.jdbc.PrestoResultSet) {\n    // Presto: skip cursor updates, use SQL UPDATE\n}","typeGuard":"boolean isPrestoResultSet(ResultSet rs) {\n    return rs instanceof com.facebook.presto.jdbc.PrestoResultSet;\n}","tryCatchPattern":"try {\n    rs.updateString(\"name\", value);\n    rs.updateRow();\n} catch (SQLFeatureNotSupportedException e) {\n    // issue UPDATE users SET name = ? WHERE id = ? instead\n}","preventionTips":["Treat Presto as an analytics engine: reads via SELECT, writes via INSERT/UPDATE SQL.","Use CONCUR_READ_ONLY at createStatement time.","Audit migrated CRUD code for updateXxx/updateRow calls when switching drivers.","Add a lint/architecture rule banning ResultSet.updateXxx in Presto modules."],"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"}