prestodb/presto · error · SQLFeatureNotSupportedException

updateInt

Error message

updateInt

What it means

PrestoResultSet.updateInt(columnIndex, x) is an unimplemented stub that throws SQLFeatureNotSupportedException unconditionally. The Presto JDBC driver deliberately does not implement the updatable result set API; every updateXxx method is a throw-only stub. Writes must go through SQL statements.

Source

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

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

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

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

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

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

    @Override
    public void updateDouble(int columnIndex, double x)

View on GitHub (pinned to 55bb57d202)

Solutions

  1. Issue an UPDATE statement via PreparedStatement with setInt instead
  2. Use INSERT statements plus executeUpdate() to add rows rather than insertRow()
  3. Gate any updateXxx usage behind supportsResultSetConcurrency checks that will be false for Presto
  4. Catch SQLFeatureNotSupportedException and route to the SQL-write code path

Example fix

// before
rs.updateInt("count", 42);
rs.updateRow();
// after
try (PreparedStatement ps = conn.prepareStatement("UPDATE t SET count = ? WHERE id = ?")) {
    ps.setInt(1, 42);
    ps.setLong(2, id);
    ps.executeUpdate();
}
Defensive patterns

Strategy: validation

Validate before calling

DatabaseMetaData md = conn.getMetaData();
if (!md.supportsResultSetConcurrency(ResultSet.TYPE_FORWARD_ONLY, ResultSet.CONCUR_UPDATABLE)) {
    // use PreparedStatement UPDATE instead of rs.updateInt
}

Type guard

boolean isUpdatable(ResultSet rs) throws SQLException {
    return rs.getConcurrency() == ResultSet.CONCUR_UPDATABLE;
}

Try / catch

try {
    rs.updateInt(columnIndex, value);
} catch (SQLFeatureNotSupportedException e) {
    // route to SQL UPDATE fallback
}

Prevention

When it happens

Trigger: Calling rs.updateInt(i, value) on a Presto ResultSet, often as part of an updateRow()/insertRow() sequence.

Common situations: ORM or data-entry tooling that edits rows in place; sample JDBC code reused against Presto; frameworks probing update support at runtime and hitting this first.

Related errors


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