prestodb/presto · error · SQLFeatureNotSupportedException
updateNull
Error message
updateNull
What it means
PrestoResultSet.updateNull(columnIndex) is an unimplemented stub. The Presto JDBC driver does not support updatable result sets; every updateXxx method throws SQLFeatureNotSupportedException with its own name as the message. Updates must be expressed as SQL statements rather than in-place row edits.
Source
Thrown at presto-jdbc/src/main/java/com/facebook/presto/jdbc/PrestoResultSet.java:774
@Override
public boolean rowInserted()
throws SQLException
{
throw new SQLFeatureNotSupportedException("rowInserted");
}
@Override
public boolean rowDeleted()
throws SQLException
{
throw new SQLFeatureNotSupportedException("rowDeleted");
}
@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)View on GitHub (pinned to 55bb57d202)
Solutions
- Issue an explicit UPDATE SQL statement via Statement/PreparedStatement instead of using ResultSet update methods
- Refactor to fetch keys, compute new values, and run an UPDATE ... WHERE key = ? statement
- Create the statement with CONCUR_READ_ONLY so misuse fails at statement creation time rather than mid-iteration
- In generic code, catch SQLFeatureNotSupportedException and route to a SQL-update path
Example fix
// before
rs.updateNull("notes");
rs.updateRow();
// after
try (PreparedStatement ps = conn.prepareStatement("UPDATE t SET notes = NULL WHERE id = ?")) {
ps.setLong(1, id);
ps.executeUpdate();
} Defensive patterns
Strategy: validation
Validate before calling
DatabaseMetaData md = conn.getMetaData();
if (!md.supportsResultSetConcurrency(ResultSet.TYPE_FORWARD_ONLY, ResultSet.CONCUR_UPDATABLE)) {
throw new IllegalStateException("Driver does not support updatable result sets; use SQL UPDATE");
} Type guard
boolean isUpdatable(ResultSet rs) throws SQLException {
return rs.getConcurrency() == ResultSet.CONCUR_UPDATABLE;
} Try / catch
try {
rs.updateNull(columnIndex);
} catch (SQLFeatureNotSupportedException e) {
// fall back to: UPDATE t SET col = NULL WHERE key = ?
} Prevention
- Create statements with CONCUR_READ_ONLY and never attempt positioned updates
- Express every modification as an UPDATE/INSERT statement
- Check supportsResultSetConcurrency before using updateXxx methods
- Avoid ORMs that rely on updatable result sets with Presto
When it happens
Trigger: Calling rs.updateNull(i) on a ResultSet, typically as part of building an in-place row update before rs.updateRow() or insertRow().
Common situations: Code written for fully updatable result sets in classic RDBMSs, then run against Presto; ORMs that fall back to positioned updates when they cannot generate SQL updates.
Related errors
AI-assisted analysis of prestodb/presto@55bb57d202 (2026-09-04).
Data as JSON: /api/errors/3a8565736c1756f1.
Report an issue: GitHub.