prestodb/presto · error · SQLFeatureNotSupportedException
updateLong
Error message
updateLong
What it means
PrestoResultSet.updateLong(columnIndex, x) is an unimplemented stub that always throws SQLFeatureNotSupportedException. Presto does not support updatable result sets, so this method can never succeed. Its only purpose is to fulfill the java.sql.ResultSet contract.
Source
Thrown at presto-jdbc/src/main/java/com/facebook/presto/jdbc/PrestoResultSet.java:809
@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)
throws SQLException
{
throw new SQLFeatureNotSupportedException("updateDouble");
}
@Override
public void updateBigDecimal(int columnIndex, BigDecimal x)View on GitHub (pinned to 55bb57d202)
Solutions
- Replace with an UPDATE SQL statement using setLong
- Perform all modifications via DML statements, keeping the ResultSet read-only
- Check DatabaseMetaData capabilities before using positioned-update APIs
- Catch SQLFeatureNotSupportedException and provide a clear read-only error message in generic code
Example fix
// before
rs.updateLong("id", 99);
rs.updateRow();
// after
try (PreparedStatement ps = conn.prepareStatement("UPDATE t SET id = ? WHERE id = ?")) {
ps.setLong(1, 99);
ps.setLong(2, oldId);
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.updateLong
} Type guard
boolean isUpdatable(ResultSet rs) throws SQLException {
return rs.getConcurrency() == ResultSet.CONCUR_UPDATABLE;
} Try / catch
try {
rs.updateLong(columnIndex, value);
} catch (SQLFeatureNotSupportedException e) {
// route to SQL UPDATE fallback
} Prevention
- Never attempt in-place row edits on Presto result sets
- Use PreparedStatement.setLong with an UPDATE statement
- Verify updatable-resultset support before using updateXxx APIs
- Handle SQLFeatureNotSupportedException as a permanent, non-retryable condition
When it happens
Trigger: Calling rs.updateLong(i, value) on any ResultSet from the Presto JDBC driver.
Common situations: JDBC code written for updatable result sets on traditional engines; generic database GUI/ETL tools that attempt in-place edits of query results.
Related errors
AI-assisted analysis of prestodb/presto@55bb57d202 (2026-09-04).
Data as JSON: /api/errors/54a05984817186dd.
Report an issue: GitHub.