prestodb/presto · error · SQLFeatureNotSupportedException

updateByte

Error message

updateByte

What it means

PrestoResultSet.updateByte(columnIndex, x) is an unimplemented stub that unconditionally throws SQLFeatureNotSupportedException. The Presto JDBC driver supports only read-only result sets, so no in-place cell modification is possible. The method exists solely to satisfy the java.sql.ResultSet interface.

Source

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

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

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

    @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)

View on GitHub (pinned to 55bb57d202)

Solutions

  1. Run an UPDATE statement with setByte parameters instead
  2. Keep result sets CONCUR_READ_ONLY and route all writes through SQL
  3. Detect support via DatabaseMetaData.supportsResultSetConcurrency before attempting updates
  4. Catch SQLFeatureNotSupportedException and surface a clear 'read-only result set' error to users

Example fix

// before
rs.updateByte("flags", (byte) 0x01);
rs.updateRow();
// after
try (PreparedStatement ps = conn.prepareStatement("UPDATE t SET flags = ? WHERE id = ?")) {
    ps.setByte(1, (byte) 0x01);
    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.updateByte
}

Type guard

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

Try / catch

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

Prevention

When it happens

Trigger: Calling rs.updateByte(i, value) while attempting to edit a row of a Presto ResultSet.

Common situations: Code ported from databases with updatable result sets; generic JDBC editors or data-grid components that write values back through the ResultSet.

Related errors


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