prestodb/presto · error · SQLFeatureNotSupportedException

updateObject

Error message

updateObject

What it means

PrestoResultSet.updateObject(int, Object, int) unconditionally throws SQLFeatureNotSupportedException("updateObject"). Presto result sets are read-only; this generic object-update stub exists only to implement java.sql.ResultSet and rejects the call immediately. No column value can be set through the cursor, regardless of the supplied object type or scaleOrLength hint.

Source

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

    @Override
    public void updateBinaryStream(int columnIndex, InputStream x, int length)
            throws SQLException
    {
        throw new SQLFeatureNotSupportedException("updateBinaryStream");
    }

    @Override
    public void updateCharacterStream(int columnIndex, Reader x, int length)
            throws SQLException
    {
        throw new SQLFeatureNotSupportedException("updateCharacterStream");
    }

    @Override
    public void updateObject(int columnIndex, Object x, int scaleOrLength)
            throws SQLException
    {
        throw new SQLFeatureNotSupportedException("updateObject");
    }

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

    @Override
    public void updateNull(String columnLabel)
            throws SQLException
    {
        throw new SQLFeatureNotSupportedException("updateNull");
    }

    @Override
    public void updateBoolean(String columnLabel, boolean x)

View on GitHub (pinned to 55bb57d202)

Solutions

  1. Replace the cursor update with a parameterized UPDATE statement, choosing the typed setter (setString, setLong, setBigDecimal, ...) per column.
  2. Buffer rows in application objects, edit there, and write changes back with batched UPDATE statements.
  3. Request CONCUR_READ_ONLY result sets and refactor any logic depending on cursor updates.
  4. Configure the tool/ORM to operate on Presto in read-only mode.

Example fix

// before
rs.updateObject(3, value, scale);
rs.updateRow();
// after
try (PreparedStatement ps = conn.prepareStatement("UPDATE t SET amount = ? WHERE id = ?")) {
    ps.setBigDecimal(1, (BigDecimal) value);
    ps.setLong(2, id);
    ps.executeUpdate();
}
Defensive patterns

Strategy: try-catch

Validate before calling

if (rs instanceof com.facebook.presto.jdbc.PrestoResultSet) {
    // Presto: generic row editing must go through SQL UPDATE, not updateObject
}

Type guard

boolean isEditableResultSet(ResultSet rs) {
    return !(rs instanceof com.facebook.presto.jdbc.PrestoResultSet) && rs.getConcurrency() == ResultSet.CONCUR_UPDATABLE;
}

Try / catch

try {
    rs.updateObject(3, value, scale);
    rs.updateRow();
} catch (SQLFeatureNotSupportedException e) {
    // dispatch to a typed PreparedStatement UPDATE for the column
}

Prevention

When it happens

Trigger: Calling updateObject(columnIndex, value, scaleOrLength) (or updateObject(columnIndex, value)) on a PrestoResultSet, typically via generic row-editing code that dispatches all types through updateObject before updateRow().

Common situations: Generic data-grid editors or ETL tools that write cells back through updateObject; ORM abstractions that use the type-neutral updateObject API; migrated CRUD code from updatable-result-set-capable drivers.

Related errors


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