prestodb/presto · error · SQLFeatureNotSupportedException

updateRow

Error message

updateRow

What it means

updateRow() belongs to JDBC's updatable result set API. Presto's PrestoResultSet is read-only, so the method always throws SQLFeatureNotSupportedException("updateRow"). Changes to result data must be issued as SQL UPDATE statements, not cursor updates.

Source

Thrown at presto-jdbc/src/main/java/com/facebook/presto/jdbc/PrestoResultSet.java:1047

    @Override
    public void updateObject(String columnLabel, Object x)
            throws SQLException
    {
        throw new SQLFeatureNotSupportedException("updateObject");
    }

    @Override
    public void insertRow()
            throws SQLException
    {
        throw new SQLFeatureNotSupportedException("insertRow");
    }

    @Override
    public void updateRow()
            throws SQLException
    {
        throw new SQLFeatureNotSupportedException("updateRow");
    }

    @Override
    public void deleteRow()
            throws SQLException
    {
        throw new SQLFeatureNotSupportedException("deleteRow");
    }

    @Override
    public void refreshRow()
            throws SQLException
    {
        throw new SQLFeatureNotSupportedException("refreshRow");
    }

    @Override
    public void cancelRowUpdates()

View on GitHub (pinned to 55bb57d202)

Solutions

  1. Replace ResultSet.updateXxx()+updateRow() with a PreparedStatement executing UPDATE ... WHERE key = ?
  2. Verify concurrency with resultSet.getConcurrency(); treat CONCUR_READ_ONLY as a signal to use SQL-based updates
  3. Restructure the application to treat Presto strictly as a query engine for reads

Example fix

// before
rs.absolute(row);
rs.updateInt("qty", 5);
rs.updateRow();
// after
try (PreparedStatement ps = conn.prepareStatement(
        "UPDATE orders SET qty = ? WHERE id = ?")) {
    ps.setInt(1, 5);
    ps.setLong(2, orderId);
    ps.executeUpdate();
}
Defensive patterns

Strategy: try-catch

Validate before calling

if (rs.getConcurrency() == ResultSet.CONCUR_READ_ONLY) {
    // use SQL UPDATE via PreparedStatement instead
}

Type guard

static boolean supportsUpdateRow(ResultSet rs) {
    try {
        return rs.getConcurrency() == ResultSet.CONCUR_UPDATABLE;
    } catch (SQLException e) {
        return false;
    }
}

Try / catch

try {
    rs.updateRow();
} catch (SQLFeatureNotSupportedException e) {
    // flush via SQL UPDATE instead
}

Prevention

When it happens

Trigger: Calling updateRow() after using updateXxx(column, value) on a PrestoResultSet to flush cursor-based modifications to the database.

Common situations: Migrating code from updatable-result-set databases (e.g. PostgreSQL) to Presto; frameworks that issue SELECT FOR UPDATE-style flows; batch update loops written against ResultSet.updateRow().

Related errors


AI-assisted analysis of prestodb/presto@55bb57d202 (2026-09-04). Data as JSON: /api/errors/85cf560e9ea47102. Report an issue: GitHub.