{"record":{"id":"f31c27306a5d03e6","repo":"apache/shardingsphere","slug":"relative","errorCode":null,"errorMessage":"relative","messagePattern":"relative","errorType":"exception","errorClass":"SQLFeatureNotSupportedException","httpStatus":null,"severity":"error","filePath":"jdbc/src/main/java/org/apache/shardingsphere/driver/jdbc/unsupported/AbstractUnsupportedOperationResultSet.java","lineNumber":85,"sourceCode":"    \n    @Override\n    public final boolean first() throws SQLException {\n        throw new SQLFeatureNotSupportedException(\"first\");\n    }\n    \n    @Override\n    public final boolean last() throws SQLException {\n        throw new SQLFeatureNotSupportedException(\"last\");\n    }\n    \n    @Override\n    public final boolean absolute(final int row) throws SQLException {\n        throw new SQLFeatureNotSupportedException(\"absolute\");\n    }\n    \n    @Override\n    public final boolean relative(final int rows) throws SQLException {\n        throw new SQLFeatureNotSupportedException(\"relative\");\n    }\n    \n    @Override\n    public final 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","sourceCodeStart":67,"sourceCodeEnd":103,"githubUrl":"https://github.com/apache/shardingsphere/blob/e952770a215630a3659c75d64369168cd3e26b82/jdbc/src/main/java/org/apache/shardingsphere/driver/jdbc/unsupported/AbstractUnsupportedOperationResultSet.java#L67-L103","documentation":"relative(int rows) moves the cursor by an offset from the current position; ShardingSphere's forward-only streaming result cannot honor it and implements the method as final, throwing SQLFeatureNotSupportedException. Only the single-row forward step next() is supported.","triggerScenarios":"Calling rs.relative(1) to double-step, or rs.relative(-1) as a substitute for previous(), on a ShardingSphere-driver ResultSet.","commonSituations":"Pair-processing code that skips every other row; backtracking attempted via relative(-1); generic cursor wrappers that normalize movement through relative().","solutions":["Use rs.next() once per row; skip rows by calling next() repeatedly and ignoring the returned rows.","Buffer rows into a List and advance an index by any offset you like.","Express skip/limit semantics in SQL (LIMIT/OFFSET) rather than cursor movement.","Give libraries requiring relative() a materialized CachedRowSet."],"exampleFix":"// before\nwhile (rs.next()) { process(rs); rs.relative(1); } // throws\n\n// after\nwhile (rs.next()) { process(rs); if (!rs.next()) break; } // explicit skip","handlingStrategy":"validation","validationCode":"if (rs.getType() == ResultSet.TYPE_FORWARD_ONLY) {\n    // only next() moves the cursor; skip rows by repeated next(), not relative(n)\n}","typeGuard":null,"tryCatchPattern":"try {\n    rs.relative(2);\n} catch (SQLFeatureNotSupportedException e) {\n    rs.next(); rs.next(); // forward skips are safe\n}","preventionTips":["Express row skipping as repeated next() calls or, better, in SQL OFFSET.","Never use relative(-1) as a substitute for previous() — both throw.","Buffer rows when step-based traversal is required."],"tags":["jdbc","resultset","cursor","relative","skip-rows"],"backgroundTag":null,"analyzedSha":"e952770a215630a3659c75d64369168cd3e26b82","analyzedAt":"2026-08-14T13:54:53.392Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}