{"record":{"id":"855739964ec6afa7","repo":"apache/shardingsphere","slug":"updatedouble","errorCode":null,"errorMessage":"updateDouble","messagePattern":"updateDouble","errorType":"exception","errorClass":"SQLFeatureNotSupportedException","httpStatus":null,"severity":"error","filePath":"kernel/sql-federation/core/src/main/java/org/apache/shardingsphere/sqlfederation/resultset/AbstractUnsupportedUpdateOperationSQLFederationResultSet.java","lineNumber":114,"sourceCode":"    \n    @Override\n    public final void updateLong(final String columnLabel, final long x) throws SQLException {\n        throw new SQLFeatureNotSupportedException(\"updateLong\");\n    }\n    \n    @Override\n    public final void updateFloat(final int columnIndex, final float x) throws SQLException {\n        throw new SQLFeatureNotSupportedException(\"updateFloat\");\n    }\n    \n    @Override\n    public final void updateFloat(final String columnLabel, final float x) throws SQLException {\n        throw new SQLFeatureNotSupportedException(\"updateFloat\");\n    }\n    \n    @Override\n    public final void updateDouble(final int columnIndex, final double x) throws SQLException {\n        throw new SQLFeatureNotSupportedException(\"updateDouble\");\n    }\n    \n    @Override\n    public final void updateDouble(final String columnLabel, final double x) throws SQLException {\n        throw new SQLFeatureNotSupportedException(\"updateDouble\");\n    }\n    \n    @Override\n    public final void updateBigDecimal(final int columnIndex, final BigDecimal x) throws SQLException {\n        throw new SQLFeatureNotSupportedException(\"updateBigDecimal\");\n    }\n    \n    @Override\n    public final void updateBigDecimal(final String columnLabel, final BigDecimal x) throws SQLException {\n        throw new SQLFeatureNotSupportedException(\"updateBigDecimal\");\n    }\n    \n    @Override","sourceCodeStart":96,"sourceCodeEnd":132,"githubUrl":"https://github.com/apache/shardingsphere/blob/e952770a215630a3659c75d64369168cd3e26b82/kernel/sql-federation/core/src/main/java/org/apache/shardingsphere/sqlfederation/resultset/AbstractUnsupportedUpdateOperationSQLFederationResultSet.java#L96-L132","documentation":"The SQL federation engine in ShardingSphere computes query results in memory and exposes them through a ResultSet whose update methods are all stubbed to throw SQLFeatureNotSupportedException in AbstractUnsupportedUpdateOperationSQLFederationResultSet. 'updateDouble' is the message for the columnIndex overload of the double updater. The design guarantees fail-fast behavior for any attempt to mutate rows through a federated cursor.","triggerScenarios":"Calling ResultSet.updateDouble(int columnIndex, double x) while iterating a federation ResultSet (query matched by an enabled sql_federation rule, e.g. cross-shard aggregation or join). Happens with updatable-grid widgets or hand-rolled row patching that assume CONCUR_UPDATABLE semantics.","commonSituations":"Porting desktop/report tooling that edits cells via updateDouble to a ShardingSphere federated datasource; enabling sqlFederation in YAML and re-running existing batch jobs that patch rows in place; integration tests exercising updateRow flows against federation results.","solutions":["Read with getDouble(columnIndex) and persist changes via a PreparedStatement UPDATE keyed on the primary key.","Before any cursor-update branch, test rs.getConcurrency(); treat CONCUR_READ_ONLY as 'use UPDATE statements'.","Exclude this statement from sql_federation (scope the rule or disable sqlFederation) so the native driver ResultSet with its own concurrency is returned."],"exampleFix":"// before\nrs.updateDouble(3, 19.99);  // SQLFeatureNotSupportedException: updateDouble\nrs.updateRow();\n\n// after\ntry (PreparedStatement upd = conn.prepareStatement(\"UPDATE products SET price = ? WHERE id = ?\")) {\n    upd.setDouble(1, 19.99);\n    upd.setLong(2, rs.getLong(1));\n    upd.executeUpdate();\n}","handlingStrategy":"try-catch","validationCode":"if (rs.getConcurrency() != ResultSet.CONCUR_UPDATABLE) {\n    // use an UPDATE statement instead of rs.updateDouble(...)\n}","typeGuard":"private static boolean supportsRowUpdates(final ResultSet rs) throws SQLException {\n    return rs.getConcurrency() == ResultSet.CONCUR_UPDATABLE;\n}","tryCatchPattern":"try {\n    rs.updateDouble(3, price);\n} catch (final SQLFeatureNotSupportedException ignored) {\n    try (PreparedStatement upd = conn.prepareStatement(\"UPDATE products SET price = ? WHERE id = ?\")) {\n        upd.setDouble(1, price);\n        upd.setLong(2, rs.getLong(1));\n        upd.executeUpdate();\n    }\n}","preventionTips":["Assume federation result sets are read-only and write via UPDATE statements.","Test edit flows against a sqlFederation-enabled datasource before shipping.","Check rs.getConcurrency() in shared JDBC utilities before calling any updateXxx method."],"tags":["jdbc","resultset","sql-federation","read-only","shardingsphere"],"backgroundTag":null,"analyzedSha":"e952770a215630a3659c75d64369168cd3e26b82","analyzedAt":"2026-08-14T13:54:53.392Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}