{"record":{"id":"542de6ea913fb29e","repo":"apache/shardingsphere","slug":"deleterow-542de6","errorCode":null,"errorMessage":"deleteRow","messagePattern":"deleteRow","errorType":"exception","errorClass":"SQLFeatureNotSupportedException","httpStatus":null,"severity":"error","filePath":"kernel/sql-federation/core/src/main/java/org/apache/shardingsphere/sqlfederation/resultset/AbstractUnsupportedOperationSQLFederationResultSet.java","lineNumber":105,"sourceCode":"    \n    @Override\n    public int getRow() throws SQLException {\n        throw new SQLFeatureNotSupportedException(\"getRow\");\n    }\n    \n    @Override\n    public final void insertRow() throws SQLException {\n        throw new SQLFeatureNotSupportedException(\"insertRow\");\n    }\n    \n    @Override\n    public final void updateRow() throws SQLException {\n        throw new SQLFeatureNotSupportedException(\"updateRow\");\n    }\n    \n    @Override\n    public final void deleteRow() throws SQLException {\n        throw new SQLFeatureNotSupportedException(\"deleteRow\");\n    }\n    \n    @Override\n    public final void refreshRow() throws SQLException {\n        throw new SQLFeatureNotSupportedException(\"refreshRow\");\n    }\n    \n    @Override\n    public final void cancelRowUpdates() throws SQLException {\n        throw new SQLFeatureNotSupportedException(\"cancelRowUpdates\");\n    }\n    \n    @Override\n    public final void moveToInsertRow() throws SQLException {\n        throw new SQLFeatureNotSupportedException(\"moveToInsertRow\");\n    }\n    \n    @Override","sourceCodeStart":87,"sourceCodeEnd":123,"githubUrl":"https://github.com/apache/shardingsphere/blob/e952770a215630a3659c75d64369168cd3e26b82/kernel/sql-federation/core/src/main/java/org/apache/shardingsphere/sqlfederation/resultset/AbstractUnsupportedOperationSQLFederationResultSet.java#L87-L123","documentation":"deleteRow() always throws SQLFeatureNotSupportedException in the federation ResultSet. Deleting through a JDBC cursor requires an updatable, positioned ResultSet; the federation engine only materializes query output forward-only and read-only, and the method is final so no subclass can override it.","triggerScenarios":"Calling rs.deleteRow() while positioned on a row of a federated query ResultSet — the cursor-based delete pattern — in an application using ShardingSphere SQL Federation.","commonSituations":"Row deletions triggered from data-grid UIs; DAOs written against updatable cursors on a legacy database; testing a federated SELECT in a DB browser whose Delete Row action maps to rs.deleteRow().","solutions":["Issue an explicit DELETE FROM t WHERE key = ? PreparedStatement instead of cursor deletion","Configure DB browser/ORM to use statement-based deletes for this connection","Check whether the query must run under federation; non-federated statements delegate to the backend driver and may keep native cursor capabilities"],"exampleFix":"// before\nrs.deleteRow();\n\n// after\ntry (PreparedStatement ps = conn.prepareStatement(\"DELETE FROM t WHERE id = ?\")) {\n    ps.setLong(1, id);\n    ps.executeUpdate();\n}","handlingStrategy":"try-catch","validationCode":"if (rs.getConcurrency() == ResultSet.CONCUR_READ_ONLY) {\n    // deleteRow() unsupported: use DELETE ... WHERE key = ?\n}","typeGuard":"private boolean isUpdatable(final ResultSet rs) throws SQLException {\n    return rs.getConcurrency() == ResultSet.CONCUR_UPDATABLE;\n}","tryCatchPattern":"try {\n    rs.deleteRow();\n} catch (final SQLFeatureNotSupportedException e) {\n    executeDelete(conn, tableName, id);\n}","preventionTips":["Delete via explicit DELETE statements only","Turn off row-deletion actions in grid tools on federation datasources","Treat CONCUR_READ_ONLY as authoritative: no cursor mutations"],"tags":["jdbc","resultset","sql-federation","updatable-cursor","delete","shardingsphere"],"backgroundTag":null,"analyzedSha":"e952770a215630a3659c75d64369168cd3e26b82","analyzedAt":"2026-08-14T13:54:53.392Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}