{"record":{"id":"7b19e7350469f83e","repo":"apache/shardingsphere","slug":"updateint","errorCode":null,"errorMessage":"updateInt","messagePattern":"updateInt","errorType":"exception","errorClass":"SQLFeatureNotSupportedException","httpStatus":null,"severity":"error","filePath":"kernel/sql-federation/core/src/main/java/org/apache/shardingsphere/sqlfederation/resultset/AbstractUnsupportedUpdateOperationSQLFederationResultSet.java","lineNumber":84,"sourceCode":"    \n    @Override\n    public final void updateByte(final String columnLabel, final byte x) throws SQLException {\n        throw new SQLFeatureNotSupportedException(\"updateByte\");\n    }\n    \n    @Override\n    public final void updateShort(final int columnIndex, final short x) throws SQLException {\n        throw new SQLFeatureNotSupportedException(\"updateShort\");\n    }\n    \n    @Override\n    public final void updateShort(final String columnLabel, final short x) throws SQLException {\n        throw new SQLFeatureNotSupportedException(\"updateShort\");\n    }\n    \n    @Override\n    public final void updateInt(final int columnIndex, final int x) throws SQLException {\n        throw new SQLFeatureNotSupportedException(\"updateInt\");\n    }\n    \n    @Override\n    public final void updateInt(final String columnLabel, final int x) throws SQLException {\n        throw new SQLFeatureNotSupportedException(\"updateInt\");\n    }\n    \n    @Override\n    public final void updateLong(final int columnIndex, final long x) throws SQLException {\n        throw new SQLFeatureNotSupportedException(\"updateLong\");\n    }\n    \n    @Override\n    public final void updateLong(final String columnLabel, final long x) throws SQLException {\n        throw new SQLFeatureNotSupportedException(\"updateLong\");\n    }\n    \n    @Override","sourceCodeStart":66,"sourceCodeEnd":102,"githubUrl":"https://github.com/apache/shardingsphere/blob/e952770a215630a3659c75d64369168cd3e26b82/kernel/sql-federation/core/src/main/java/org/apache/shardingsphere/sqlfederation/resultset/AbstractUnsupportedUpdateOperationSQLFederationResultSet.java#L66-L102","documentation":"updateInt(int, int) is one of the most commonly invoked members of the updatable-ResultSet API, and it is explicitly unsupported by ShardingSphere's federation engine. The final override in AbstractUnsupportedUpdateOperationSQLFederationResultSet throws SQLFeatureNotSupportedException on every call because federated rows are read-only.","triggerScenarios":"Calling ResultSet.updateInt(columnIndex, value) (then updateRow()) on a ResultSet returned by a federated query — e.g. editing an integer column of a joined, cross-shard result in place.","commonSituations":"Table-editor components and rowset frameworks doing client-side edits; code that worked against a driver-issued CONCUR_UPDATABLE ResultSet before sql-federation was enabled; JTable/DbGrid style admin UIs.","solutions":["Replace with an explicit UPDATE table SET col = ? WHERE pk = ? executed through ShardingSphere.","Verify rs.getConcurrency() == ResultSet.CONCUR_UPDATABLE before any updateXXX call and otherwise branch to SQL updates.","Ensure interactive editing uses a non-federated datasource or federation is disabled for those statements.","Cover mutation paths with federation-enabled integration tests in CI."],"exampleFix":"// before\nresultSet.updateInt(3, 100);\nresultSet.updateRow();\n\n// after\n// UPDATE account SET balance = 100 WHERE id = ?","handlingStrategy":"validation","validationCode":"if (resultSet.getConcurrency() != ResultSet.CONCUR_UPDATABLE) { throw new SQLFeatureNotSupportedException(\"in-place updates not supported; use UPDATE SQL\"); }","typeGuard":"boolean isUpdatable(ResultSet rs) throws SQLException { return rs.getConcurrency() == ResultSet.CONCUR_UPDATABLE; }","tryCatchPattern":"try { rs.updateInt(3, 100); rs.updateRow(); } catch (SQLFeatureNotSupportedException e) { /* UPDATE account SET balance = 100 WHERE id = ? */ }","preventionTips":["Replace client-side row edits with keyed UPDATE statements under federation.","Check getConcurrency() before any updateXXX call.","Keep interactive editors on non-federated datasources."],"tags":["jdbc","sql-federation","resultset","unsupported-operation","readonly","updatable-resultset"],"backgroundTag":null,"analyzedSha":"e952770a215630a3659c75d64369168cd3e26b82","analyzedAt":"2026-08-14T13:54:53.392Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}