{"record":{"id":"8dbe6d4c49032e68","repo":"prestodb/presto","slug":"updateobject","errorCode":null,"errorMessage":"updateObject","messagePattern":"updateObject","errorType":"exception","errorClass":"SQLFeatureNotSupportedException","httpStatus":null,"severity":"error","filePath":"presto-jdbc/src/main/java/com/facebook/presto/jdbc/PrestoResultSet.java","lineNumber":893,"sourceCode":"    @Override\n    public void updateBinaryStream(int columnIndex, InputStream x, int length)\n            throws SQLException\n    {\n        throw new SQLFeatureNotSupportedException(\"updateBinaryStream\");\n    }\n\n    @Override\n    public void updateCharacterStream(int columnIndex, Reader x, int length)\n            throws SQLException\n    {\n        throw new SQLFeatureNotSupportedException(\"updateCharacterStream\");\n    }\n\n    @Override\n    public void updateObject(int columnIndex, Object x, int scaleOrLength)\n            throws SQLException\n    {\n        throw new SQLFeatureNotSupportedException(\"updateObject\");\n    }\n\n    @Override\n    public void updateObject(int columnIndex, Object x)\n            throws SQLException\n    {\n        throw new SQLFeatureNotSupportedException(\"updateObject\");\n    }\n\n    @Override\n    public void updateNull(String columnLabel)\n            throws SQLException\n    {\n        throw new SQLFeatureNotSupportedException(\"updateNull\");\n    }\n\n    @Override\n    public void updateBoolean(String columnLabel, boolean x)","sourceCodeStart":875,"sourceCodeEnd":911,"githubUrl":"https://github.com/prestodb/presto/blob/55bb57d202de3b926896fa966c2c4a44c779634e/presto-jdbc/src/main/java/com/facebook/presto/jdbc/PrestoResultSet.java#L875-L911","documentation":"PrestoResultSet.updateObject(int, Object, int) unconditionally throws SQLFeatureNotSupportedException(\"updateObject\"). Presto result sets are read-only; this generic object-update stub exists only to implement java.sql.ResultSet and rejects the call immediately. No column value can be set through the cursor, regardless of the supplied object type or scaleOrLength hint.","triggerScenarios":"Calling updateObject(columnIndex, value, scaleOrLength) (or updateObject(columnIndex, value)) on a PrestoResultSet, typically via generic row-editing code that dispatches all types through updateObject before updateRow().","commonSituations":"Generic data-grid editors or ETL tools that write cells back through updateObject; ORM abstractions that use the type-neutral updateObject API; migrated CRUD code from updatable-result-set-capable drivers.","solutions":["Replace the cursor update with a parameterized UPDATE statement, choosing the typed setter (setString, setLong, setBigDecimal, ...) per column.","Buffer rows in application objects, edit there, and write changes back with batched UPDATE statements.","Request CONCUR_READ_ONLY result sets and refactor any logic depending on cursor updates.","Configure the tool/ORM to operate on Presto in read-only mode."],"exampleFix":"// before\nrs.updateObject(3, value, scale);\nrs.updateRow();\n// after\ntry (PreparedStatement ps = conn.prepareStatement(\"UPDATE t SET amount = ? WHERE id = ?\")) {\n    ps.setBigDecimal(1, (BigDecimal) value);\n    ps.setLong(2, id);\n    ps.executeUpdate();\n}","handlingStrategy":"try-catch","validationCode":"if (rs instanceof com.facebook.presto.jdbc.PrestoResultSet) {\n    // Presto: generic row editing must go through SQL UPDATE, not updateObject\n}","typeGuard":"boolean isEditableResultSet(ResultSet rs) {\n    return !(rs instanceof com.facebook.presto.jdbc.PrestoResultSet) && rs.getConcurrency() == ResultSet.CONCUR_UPDATABLE;\n}","tryCatchPattern":"try {\n    rs.updateObject(3, value, scale);\n    rs.updateRow();\n} catch (SQLFeatureNotSupportedException e) {\n    // dispatch to a typed PreparedStatement UPDATE for the column\n}","preventionTips":["In generic editors, map column types to typed PreparedStatement setters instead of updateObject.","Treat Presto connections as read-only in any tooling configuration.","Use CONCUR_READ_ONLY when creating statements to fail early on wrong assumptions.","Batch buffered edits into UPDATE ... WHERE id IN (...) statements rather than per-row cursor updates."],"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"}