{"record":{"id":"885b554cebe4f60b","repo":"apache/shardingsphere","slug":"updateboolean","errorCode":null,"errorMessage":"updateBoolean","messagePattern":"updateBoolean","errorType":"exception","errorClass":"SQLFeatureNotSupportedException","httpStatus":null,"severity":"error","filePath":"kernel/sql-federation/core/src/main/java/org/apache/shardingsphere/sqlfederation/resultset/AbstractUnsupportedUpdateOperationSQLFederationResultSet.java","lineNumber":54,"sourceCode":"\n/**\n * Unsupported {@code ResultSet} update methods for SQL federation.\n */\npublic abstract class AbstractUnsupportedUpdateOperationSQLFederationResultSet extends SQLFederationWrapperAdapter implements ResultSet {\n    \n    @Override\n    public final void updateNull(final int columnIndex) throws SQLException {\n        throw new SQLFeatureNotSupportedException(\"updateNull\");\n    }\n    \n    @Override\n    public final void updateNull(final String columnLabel) throws SQLException {\n        throw new SQLFeatureNotSupportedException(\"updateNull\");\n    }\n    \n    @Override\n    public final void updateBoolean(final int columnIndex, final boolean x) throws SQLException {\n        throw new SQLFeatureNotSupportedException(\"updateBoolean\");\n    }\n    \n    @Override\n    public final void updateBoolean(final String columnLabel, final boolean x) throws SQLException {\n        throw new SQLFeatureNotSupportedException(\"updateBoolean\");\n    }\n    \n    @Override\n    public final void updateByte(final int columnIndex, final byte x) throws SQLException {\n        throw new SQLFeatureNotSupportedException(\"updateByte\");\n    }\n    \n    @Override\n    public final void updateByte(final String columnLabel, final byte x) throws SQLException {\n        throw new SQLFeatureNotSupportedException(\"updateByte\");\n    }\n    \n    @Override","sourceCodeStart":36,"sourceCodeEnd":72,"githubUrl":"https://github.com/apache/shardingsphere/blob/e952770a215630a3659c75d64369168cd3e26b82/kernel/sql-federation/core/src/main/java/org/apache/shardingsphere/sqlfederation/resultset/AbstractUnsupportedUpdateOperationSQLFederationResultSet.java#L36-L72","documentation":"updateBoolean(int, boolean) belongs to the updatable-ResultSet API that ShardingSphere's SQL federation engine does not support. Federated rows are read-only materializations, so the final method throws SQLFeatureNotSupportedException on every invocation.","triggerScenarios":"Calling ResultSet.updateBoolean(1, true) (then usually updateRow()) on a federation ResultSet — any in-place boolean column edit performed client-side.","commonSituations":"Editable table/grid widgets bound to JDBC; DAO frameworks using updatable ResultSets for toggle-style fields; switching a working driver-based app to a ShardingSphere federation datasource without testing row-edit flows.","solutions":["Persist the change with an explicit UPDATE table SET flag = ? WHERE key = ? PreparedStatement.","Gate editability on rs.getConcurrency() and degrade to SQL updates when CONCUR_READ_ONLY.","Keep editing workflows on a non-federated datasource.","Add a federation-mode integration test covering every mutation path in the app."],"exampleFix":"// before\nresultSet.updateBoolean(2, true);\nresultSet.updateRow();\n\n// after\n// UPDATE task SET done = ? WHERE id = ?","handlingStrategy":"validation","validationCode":"if (resultSet.getConcurrency() != ResultSet.CONCUR_UPDATABLE) { throw new SQLFeatureNotSupportedException(\"client-side updates unavailable\"); }","typeGuard":"boolean isUpdatable(ResultSet rs) throws SQLException { return rs.getConcurrency() == ResultSet.CONCUR_UPDATABLE; }","tryCatchPattern":"try { rs.updateBoolean(2, true); rs.updateRow(); } catch (SQLFeatureNotSupportedException e) { /* UPDATE task SET done = ? WHERE id = ? */ }","preventionTips":["Use explicit UPDATE statements for boolean toggles under federation.","Gate editable UI on concurrency checks.","Add federation integration tests for all mutation paths."],"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-15T17:31:12.345Z"}