prestodb/presto · error · SQLFeatureNotSupportedException

updateTime

Error message

updateTime

What it means

PrestoResultSet.updateTime(int, java.sql.Time) always throws SQLFeatureNotSupportedException("updateTime"). The Presto JDBC driver provides read-only result sets; the updateXxx methods are stubs that satisfy the JDBC interface and immediately reject use. TIME column values cannot be changed via the ResultSet cursor.

Source

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

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

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

    @Override
    public void updateAsciiStream(int columnIndex, InputStream x, int length)
            throws SQLException
    {
        throw new SQLFeatureNotSupportedException("updateAsciiStream");
    }

    @Override
    public void updateBinaryStream(int columnIndex, InputStream x, int length)

View on GitHub (pinned to 55bb57d202)

Solutions

  1. Execute an UPDATE statement with setTime/setLocalTime parameters instead.
  2. Use a set-based SQL expression for bulk time changes.
  3. Request read-only concurrency (CONCUR_READ_ONLY) from createStatement and refactor dependent code.
  4. Mark the datasource read-only in any ORM/connection-pool configuration.

Example fix

// before
rs.updateTime("start_time", newStart);
rs.updateRow();
// after
try (PreparedStatement ps = conn.prepareStatement("UPDATE shifts SET start_time = ? WHERE id = ?")) {
    ps.setTime(1, newStart);
    ps.setLong(2, id);
    ps.executeUpdate();
}
Defensive patterns

Strategy: try-catch

Validate before calling

if (rs instanceof com.facebook.presto.jdbc.PrestoResultSet) {
    // Presto: use UPDATE with setTime instead of updateTime/updateRow
}

Type guard

boolean isUpdatableCursor(ResultSet rs) {
    return !(rs instanceof com.facebook.presto.jdbc.PrestoResultSet) && rs.getConcurrency() == ResultSet.CONCUR_UPDATABLE;
}

Try / catch

try {
    rs.updateTime("start_time", newStart);
    rs.updateRow();
} catch (SQLFeatureNotSupportedException e) {
    // execute UPDATE shifts SET start_time = ? WHERE id = ?
}

Prevention

When it happens

Trigger: Calling updateTime(columnIndex, time) or updateTime(columnLabel, time) on a PrestoResultSet when attempting an in-place edit of a TIME column before updateRow().

Common situations: Code migrated from an updatable-result-set-capable driver (MySQL, PostgreSQL); scheduling- adjustment scripts editing times row by row; frameworks detecting CONCUR_UPDATABLE and assuming real support.

Related errors


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