apache/shardingsphere · error · SQLFeatureNotSupportedException

updateBoolean

Error message

updateBoolean

What it means

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.

Source

Thrown at kernel/sql-federation/core/src/main/java/org/apache/shardingsphere/sqlfederation/resultset/AbstractUnsupportedUpdateOperationSQLFederationResultSet.java:54

/**
 * Unsupported {@code ResultSet} update methods for SQL federation.
 */
public abstract class AbstractUnsupportedUpdateOperationSQLFederationResultSet extends SQLFederationWrapperAdapter implements ResultSet {
    
    @Override
    public final void updateNull(final int columnIndex) throws SQLException {
        throw new SQLFeatureNotSupportedException("updateNull");
    }
    
    @Override
    public final void updateNull(final String columnLabel) throws SQLException {
        throw new SQLFeatureNotSupportedException("updateNull");
    }
    
    @Override
    public final void updateBoolean(final int columnIndex, final boolean x) throws SQLException {
        throw new SQLFeatureNotSupportedException("updateBoolean");
    }
    
    @Override
    public final void updateBoolean(final String columnLabel, final boolean x) throws SQLException {
        throw new SQLFeatureNotSupportedException("updateBoolean");
    }
    
    @Override
    public final void updateByte(final int columnIndex, final byte x) throws SQLException {
        throw new SQLFeatureNotSupportedException("updateByte");
    }
    
    @Override
    public final void updateByte(final String columnLabel, final byte x) throws SQLException {
        throw new SQLFeatureNotSupportedException("updateByte");
    }
    
    @Override

View on GitHub (pinned to e952770a21)

Solutions

  1. Persist the change with an explicit UPDATE table SET flag = ? WHERE key = ? PreparedStatement.
  2. Gate editability on rs.getConcurrency() and degrade to SQL updates when CONCUR_READ_ONLY.
  3. Keep editing workflows on a non-federated datasource.
  4. Add a federation-mode integration test covering every mutation path in the app.

Example fix

// before
resultSet.updateBoolean(2, true);
resultSet.updateRow();

// after
// UPDATE task SET done = ? WHERE id = ?
Defensive patterns

Strategy: validation

Validate before calling

if (resultSet.getConcurrency() != ResultSet.CONCUR_UPDATABLE) { throw new SQLFeatureNotSupportedException("client-side updates unavailable"); }

Type guard

boolean isUpdatable(ResultSet rs) throws SQLException { return rs.getConcurrency() == ResultSet.CONCUR_UPDATABLE; }

Try / catch

try { rs.updateBoolean(2, true); rs.updateRow(); } catch (SQLFeatureNotSupportedException e) { /* UPDATE task SET done = ? WHERE id = ? */ }

Prevention

When it happens

Trigger: Calling ResultSet.updateBoolean(1, true) (then usually updateRow()) on a federation ResultSet — any in-place boolean column edit performed client-side.

Common situations: 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.

Related errors


AI-assisted analysis of apache/shardingsphere@e952770a21 (2026-08-14). Data as JSON: /api/errors/885b554cebe4f60b. Report an issue: GitHub.