prestodb/presto · error · SQLFeatureNotSupportedException
updateString
Error message
updateString
What it means
PrestoResultSet.updateString(int, String) unconditionally throws SQLFeatureNotSupportedException("updateString"). The Presto JDBC driver ships read-only result sets; all ResultSet updateXxx methods are interface-compliance stubs that reject the call. Row data returned by a query cannot be modified through the cursor.
Source
Thrown at presto-jdbc/src/main/java/com/facebook/presto/jdbc/PrestoResultSet.java:837
@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)
throws SQLException
{
throw new SQLFeatureNotSupportedException("updateBytes");
}
@Override
public void updateDate(int columnIndex, Date x)
throws SQLException
{
throw new SQLFeatureNotSupportedException("updateDate");
}
@Override
public void updateTime(int columnIndex, Time x)View on GitHub (pinned to 55bb57d202)
Solutions
- Issue an explicit UPDATE statement (preferably PreparedStatement with parameters) instead of using updateString/updateRow.
- Use CONCUR_READ_ONLY result sets and copy values into application objects if transformation is needed.
- For bulk corrections, run a single UPDATE ... WHERE query rather than row-by-row cursor updates.
- If an ORM triggers it, mark the Presto datasource as read-only in the ORM configuration.
Example fix
// before
rs.updateString("name", newName);
rs.updateRow();
// after
try (PreparedStatement ps = conn.prepareStatement("UPDATE users SET name = ? WHERE id = ?")) {
ps.setString(1, newName);
ps.setLong(2, id);
ps.executeUpdate();
} Defensive patterns
Strategy: try-catch
Validate before calling
if (conn.getMetaData().allProceduresAreCallable() && rs instanceof com.facebook.presto.jdbc.PrestoResultSet) {
// Presto: skip cursor updates, use SQL UPDATE
} Type guard
boolean isPrestoResultSet(ResultSet rs) {
return rs instanceof com.facebook.presto.jdbc.PrestoResultSet;
} Try / catch
try {
rs.updateString("name", value);
rs.updateRow();
} catch (SQLFeatureNotSupportedException e) {
// issue UPDATE users SET name = ? WHERE id = ? instead
} Prevention
- Treat Presto as an analytics engine: reads via SELECT, writes via INSERT/UPDATE SQL.
- Use CONCUR_READ_ONLY at createStatement time.
- Audit migrated CRUD code for updateXxx/updateRow calls when switching drivers.
- Add a lint/architecture rule banning ResultSet.updateXxx in Presto modules.
When it happens
Trigger: Calling updateString(columnIndex, value) or updateString(columnLabel, value) on a ResultSet obtained from the Presto driver, usually in code that pairs updateString with updateRow() to edit a VARCHAR column in place.
Common situations: Migrating legacy JDBC CRUD code from a traditional RDBMS to Presto; data-fix scripts that walk a ResultSet and patch column values; report-generation code that mutates cells before persistence.
Related errors
AI-assisted analysis of prestodb/presto@55bb57d202 (2026-09-04).
Data as JSON: /api/errors/4924e91ded39e483.
Report an issue: GitHub.