{"record":{"id":"fb60ebf34eecaa65","repo":"apache/shardingsphere","slug":"movetocurrentrow","errorCode":null,"errorMessage":"moveToCurrentRow","messagePattern":"moveToCurrentRow","errorType":"exception","errorClass":"SQLFeatureNotSupportedException","httpStatus":null,"severity":"error","filePath":"jdbc/src/main/java/org/apache/shardingsphere/driver/jdbc/unsupported/AbstractUnsupportedOperationResultSet.java","lineNumber":125,"sourceCode":"    \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\n    public final void moveToCurrentRow() throws SQLException {\n        throw new SQLFeatureNotSupportedException(\"moveToCurrentRow\");\n    }\n    \n    @Override\n    public final boolean rowInserted() throws SQLException {\n        throw new SQLFeatureNotSupportedException(\"rowInserted\");\n    }\n    \n    @Override\n    public final boolean rowUpdated() throws SQLException {\n        throw new SQLFeatureNotSupportedException(\"rowUpdated\");\n    }\n    \n    @Override\n    public final boolean rowDeleted() throws SQLException {\n        throw new SQLFeatureNotSupportedException(\"rowDeleted\");\n    }\n    \n    @Override","sourceCodeStart":107,"sourceCodeEnd":143,"githubUrl":"https://github.com/apache/shardingsphere/blob/e952770a215630a3659c75d64369168cd3e26b82/jdbc/src/main/java/org/apache/shardingsphere/driver/jdbc/unsupported/AbstractUnsupportedOperationResultSet.java#L107-L143","documentation":"moveToCurrentRow() is final in AbstractUnsupportedOperationResultSet and throws SQLFeatureNotSupportedException unconditionally. It only has meaning after moveToInsertRow() on an updatable cursor, and the sharding ResultSet supports neither, so the call is rejected outright.","triggerScenarios":"Calling ResultSet.moveToCurrentRow() on a sharding ResultSet, usually as part of a cursor-insert/edit flow (after insertRow or when leaving the insert row) inside ORM or UI grid code.","commonSituations":"CRUD form frameworks that pair moveToInsertRow/insertRow/moveToCurrentRow; code copied from driver documentation for updatable ResultSets (MySQL, Oracle, DB2) and run against the sharding URL.","solutions":["Remove the whole cursor-insert block and replace it with plain INSERT SQL.","Re-point the editing component at the physical datasource connection if cursor semantics are non-negotiable.","Ensure Statement is created with ResultSet.CONCUR_READ_ONLY so frameworks never enter the updatable-cursor code path."],"exampleFix":"// before\nrs.insertRow();\nrs.moveToCurrentRow(); // throws\n\n// after\n// after executing the INSERT PreparedStatement, simply continue using the query ResultSet\n// no moveToCurrentRow call exists","handlingStrategy":"try-catch","validationCode":"// only reachable after moveToInsertRow; guard that call instead\nboolean canUseInsertRow = rs.getConcurrency() != ResultSet.CONCUR_READ_ONLY;","typeGuard":null,"tryCatchPattern":"try {\n    rs.moveToCurrentRow();\n} catch (SQLFeatureNotSupportedException e) {\n    // no cursor-insert mode was ever entered; nothing to restore\n}","preventionTips":["Remove paired moveToInsertRow/moveToCurrentRow blocks during migration.","Centralize inserts in a DAO that uses INSERT SQL."],"tags":["jdbc","resultset","row-updates","shardingsphere","unsupported-operation"],"backgroundTag":null,"analyzedSha":"e952770a215630a3659c75d64369168cd3e26b82","analyzedAt":"2026-08-14T13:54:53.392Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}