pentaho/pentaho-kettle · error · KettleDatabaseException

Unable to move resultset to position " + position

Error message

Unable to move resultset to position " + position

What it means

KettleDatabaseException wrapper for ResultSet.absolute(position) failures. absolute() moves the cursor to the given row number and requires a scrollable result set; any SQLException is rethrown with this message.

Solutions

  1. Create the statement with TYPE_SCROLL_INSENSITIVE/TYPE_SCROLL_SENSITIVE instead of TYPE_FORWARD_ONLY
  2. Check rs.getType() before calling absolute and fall back to re-querying with LIMIT/OFFSET
  3. Validate the position is within the result set size
  4. Update the JDBC driver if scroll support is broken

Example fix

// before
Statement st = conn.createStatement();
db.absolute(rs, 100);
// after
Statement st = conn.createStatement(
  ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_READ_ONLY);
rs = st.executeQuery(sql);
if (rs.getType() != ResultSet.TYPE_FORWARD_ONLY) {
  db.absolute(rs, 100);
}
Defensive patterns

Strategy: validation

Validate before calling

if (rs.getType() == ResultSet.TYPE_FORWARD_ONLY) {
  throw new IllegalStateException("absolute() requires a scrollable result set");
}

Type guard

null

Try / catch

try {
  db.absolute(rs, pos);
} catch (KettleDatabaseException e) {
  // fall back: re-query with LIMIT/OFFSET for the target row
}

Prevention

When it happens

Trigger: Calling Database.absolute(rs, position) on a result set that is not scrollable (created with TYPE_FORWARD_ONLY), position beyond row count, or the driver rejecting cursor movement.

Common situations: Using absolute() on a default forward-only statement; drivers that don't support scrollable cursors (some MySQL settings); position 0 or negative without proper handling.

Understand the failure class

Background: UnsupportedOperationException and "is not supported" errors: when a library deliberately refuses a call — this error's family across 30 libraries.

Related errors


AI-assisted analysis of pentaho/pentaho-kettle@f3058517a1 (2026-09-13). Data as JSON: /api/errors/9b67eb59e38c36fe. Report an issue: GitHub.

Appendix: source

Thrown at core/src/main/java/org/pentaho/di/core/database/Database.java:2945

      if ( v != null ) {
        valueMeta = v;
        break;
      }
    }

    if ( valueMeta != null ) {
      return valueMeta;
    }

    throw new KettleDatabaseException( "Unable to handle database column '"
      + name + "', on column index " + i + " : not a handled data type" );
  }

  public boolean absolute( ResultSet rs, int position ) throws KettleDatabaseException {
    try {
      return rs.absolute( position );
    } catch ( SQLException e ) {
      throw new KettleDatabaseException( "Unable to move resultset to position " + position, e );
    }
  }

  public boolean relative( ResultSet rs, int rows ) throws KettleDatabaseException {
    try {
      return rs.relative( rows );
    } catch ( SQLException e ) {
      throw new KettleDatabaseException( "Unable to move the resultset forward " + rows + " rows", e );
    }
  }

  public void afterLast( ResultSet rs ) throws KettleDatabaseException {
    try {
      rs.afterLast();
    } catch ( SQLException e ) {
      throw new KettleDatabaseException( "Unable to move resultset to after the last position", e );
    }
  }

View on GitHub (pinned to f3058517a1)