prestodb/presto · error · SQLFeatureNotSupportedException

updateDouble

Error message

updateDouble

What it means

PrestoResultSet.updateDouble(columnIndex, x) is an unimplemented stub that always throws SQLFeatureNotSupportedException. The Presto JDBC driver does not implement updatable result sets; this method exists only to satisfy the JDBC interface and can never return normally. Writes must be expressed as SQL DML statements.

Solutions

  1. Replace with an UPDATE statement using PreparedStatement.setDouble
  2. Route all writes through SQL and keep the ResultSet strictly read-only
  3. Skip updateXxx calls when supportsResultSetConcurrency(CONCUR_UPDATABLE) reports false
  4. Catch SQLFeatureNotSupportedException and translate it to a user-facing 'result sets are read-only' message

Example fix

// before
rs.updateDouble("price", 19.99);
rs.updateRow();
// after
try (PreparedStatement ps = conn.prepareStatement("UPDATE t SET price = ? WHERE id = ?")) {
    ps.setDouble(1, 19.99);
    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.updateDouble
}

Type guard

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

Try / catch

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

Prevention

When it happens

Trigger: Calling rs.updateDouble(i, value) on any Presto ResultSet, usually followed by updateRow() or insertRow().

Common situations: Generic JDBC frameworks and data-grid editors that modify cells in place; application code reused from traditional RDBMS deployments and run against Presto.

Related errors


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

Appendix: source

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

    @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)
            throws SQLException
    {
        throw new SQLFeatureNotSupportedException("updateDouble");
    }

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

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

    @Override
    public void updateBytes(int columnIndex, byte[] x)

View on GitHub (pinned to 55bb57d202)