{"record":{"id":"7eab755a87b076c1","repo":"apache/shardingsphere","slug":"absolute","errorCode":null,"errorMessage":"absolute","messagePattern":"absolute","errorType":"exception","errorClass":"SQLFeatureNotSupportedException","httpStatus":null,"severity":"error","filePath":"jdbc/src/main/java/org/apache/shardingsphere/driver/jdbc/unsupported/AbstractUnsupportedOperationResultSet.java","lineNumber":80,"sourceCode":"    \n    @Override\n    public final void afterLast() throws SQLException {\n        throw new SQLFeatureNotSupportedException(\"afterLast\");\n    }\n    \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","sourceCodeStart":62,"sourceCodeEnd":98,"githubUrl":"https://github.com/apache/shardingsphere/blob/e952770a215630a3659c75d64369168cd3e26b82/jdbc/src/main/java/org/apache/shardingsphere/driver/jdbc/unsupported/AbstractUnsupportedOperationResultSet.java#L62-L98","documentation":"absolute(int row) positions the cursor at an arbitrary row number; ShardingSphere's merged result set is forward-only and final-blocks this method with SQLFeatureNotSupportedException. Random positioning across a multi-shard merge would require full materialization, which the driver deliberately avoids for memory reasons.","triggerScenarios":"Calling rs.absolute(5), rs.absolute(-1) (last row), or any absolute(n) on a query result obtained through ShardingDataSource/ShardingSphereDataSource.","commonSituations":"Hand-rolled pagination that seeks to page start via absolute(offset+1); jumping to the last row with absolute(-1); Swing/table-model code or export tools that random-access rows.","solutions":["Push pagination into SQL: append LIMIT <size> OFFSET <start> (or database-native syntax) so shards return only the needed window.","For UI-style random access, load all rows once into a List or CachedRowSet and index them.","Use ORDER BY with a tiebreaker column so LIMIT/OFFSET paging is deterministic across shards.","Verify any third-party paginator is configured for SQL-based paging, not cursor-based."],"exampleFix":"// before\nResultSet rs = ps.executeQuery();\nrs.absolute(pageStart + 1); // throws\n\n// after\nString sql = \"SELECT * FROM t_order ORDER BY order_id LIMIT ? OFFSET ?\";\nPreparedStatement ps = conn.prepareStatement(sql);\nps.setInt(1, pageSize); ps.setInt(2, pageStart);\nResultSet rs = ps.executeQuery();","handlingStrategy":"fallback","validationCode":"if (rs.getType() == ResultSet.TYPE_FORWARD_ONLY) {\n    // no absolute positioning: push paging into SQL with LIMIT/OFFSET and ORDER BY\n}","typeGuard":null,"tryCatchPattern":"try {\n    rs.absolute(pageStart + 1);\n} catch (SQLFeatureNotSupportedException e) {\n    // re-query with LIMIT ? OFFSET ? and a deterministic ORDER BY\n}","preventionTips":["Make LIMIT/OFFSET the only paging mechanism against sharded tables; always add ORDER BY with a unique tiebreaker.","Cache materialized rows when a grid component needs random access.","Verify third-party paginator configuration is SQL-based, not cursor-based."],"tags":["jdbc","resultset","cursor","pagination","absolute"],"backgroundTag":null,"analyzedSha":"e952770a215630a3659c75d64369168cd3e26b82","analyzedAt":"2026-08-14T13:54:53.392Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}