prestodb/presto · error · SQLFeatureNotSupportedException
updateShort
Error message
updateShort
What it means
PrestoResultSet.updateShort(columnIndex, x) is an unimplemented stub that always throws SQLFeatureNotSupportedException. Presto result sets are read-only snapshots; the driver provides no mechanism for in-place updates. Any updateXxx call fails immediately regardless of the statement that produced the result set.
Source
Thrown at presto-jdbc/src/main/java/com/facebook/presto/jdbc/PrestoResultSet.java:795
@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)
throws SQLException
{
throw new SQLFeatureNotSupportedException("updateLong");
}
@Override
public void updateFloat(int columnIndex, float x)View on GitHub (pinned to 55bb57d202)
Solutions
- Replace with a PreparedStatement issuing UPDATE table SET col = ? WHERE ...
- Restructure the workflow to read, compute in Java, then write via SQL
- Create read-only statements and never attempt positioned updates on Presto
- Catch SQLFeatureNotSupportedException as a signal to fall back to SQL-based writes
Example fix
// before
rs.updateShort("qty", (short) 5);
rs.updateRow();
// after
try (PreparedStatement ps = conn.prepareStatement("UPDATE t SET qty = ? WHERE id = ?")) {
ps.setShort(1, (short) 5);
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.updateShort
} Type guard
boolean isUpdatable(ResultSet rs) throws SQLException {
return rs.getConcurrency() == ResultSet.CONCUR_UPDATABLE;
} Try / catch
try {
rs.updateShort(columnIndex, value);
} catch (SQLFeatureNotSupportedException e) {
// route to SQL UPDATE fallback
} Prevention
- Do not use ResultSet-based editing workflows with Presto
- Write values via PreparedStatement.executeUpdate
- Check statement concurrency before iterating rows
- Centralize writes in a data-access layer that emits DML
When it happens
Trigger: Calling rs.updateShort(i, value) on a Presto ResultSet, typically before updateRow().
Common situations: Portable JDBC persistence layers using updatable result sets; code migrated from MySQL/PostgreSQL to Presto without removing ResultSet write calls.
Related errors
AI-assisted analysis of prestodb/presto@55bb57d202 (2026-09-04).
Data as JSON: /api/errors/529a749700983a92.
Report an issue: GitHub.