{"record":{"id":"7200bc5b795e6dfc","repo":"prestodb/presto","slug":"updatetime","errorCode":null,"errorMessage":"updateTime","messagePattern":"updateTime","errorType":"exception","errorClass":"SQLFeatureNotSupportedException","httpStatus":null,"severity":"error","filePath":"presto-jdbc/src/main/java/com/facebook/presto/jdbc/PrestoResultSet.java","lineNumber":858,"sourceCode":"    @Override\n    public void updateBytes(int columnIndex, byte[] x)\n            throws SQLException\n    {\n        throw new SQLFeatureNotSupportedException(\"updateBytes\");\n    }\n\n    @Override\n    public void updateDate(int columnIndex, Date x)\n            throws SQLException\n    {\n        throw new SQLFeatureNotSupportedException(\"updateDate\");\n    }\n\n    @Override\n    public void updateTime(int columnIndex, Time x)\n            throws SQLException\n    {\n        throw new SQLFeatureNotSupportedException(\"updateTime\");\n    }\n\n    @Override\n    public void updateTimestamp(int columnIndex, Timestamp x)\n            throws SQLException\n    {\n        throw new SQLFeatureNotSupportedException(\"updateTimestamp\");\n    }\n\n    @Override\n    public void updateAsciiStream(int columnIndex, InputStream x, int length)\n            throws SQLException\n    {\n        throw new SQLFeatureNotSupportedException(\"updateAsciiStream\");\n    }\n\n    @Override\n    public void updateBinaryStream(int columnIndex, InputStream x, int length)","sourceCodeStart":840,"sourceCodeEnd":876,"githubUrl":"https://github.com/prestodb/presto/blob/55bb57d202de3b926896fa966c2c4a44c779634e/presto-jdbc/src/main/java/com/facebook/presto/jdbc/PrestoResultSet.java#L840-L876","documentation":"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.","triggerScenarios":"Calling updateTime(columnIndex, time) or updateTime(columnLabel, time) on a PrestoResultSet when attempting an in-place edit of a TIME column before updateRow().","commonSituations":"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.","solutions":["Execute an UPDATE statement with setTime/setLocalTime parameters instead.","Use a set-based SQL expression for bulk time changes.","Request read-only concurrency (CONCUR_READ_ONLY) from createStatement and refactor dependent code.","Mark the datasource read-only in any ORM/connection-pool configuration."],"exampleFix":"// before\nrs.updateTime(\"start_time\", newStart);\nrs.updateRow();\n// after\ntry (PreparedStatement ps = conn.prepareStatement(\"UPDATE shifts SET start_time = ? WHERE id = ?\")) {\n    ps.setTime(1, newStart);\n    ps.setLong(2, id);\n    ps.executeUpdate();\n}","handlingStrategy":"try-catch","validationCode":"if (rs instanceof com.facebook.presto.jdbc.PrestoResultSet) {\n    // Presto: use UPDATE with setTime instead of updateTime/updateRow\n}","typeGuard":"boolean isUpdatableCursor(ResultSet rs) {\n    return !(rs instanceof com.facebook.presto.jdbc.PrestoResultSet) && rs.getConcurrency() == ResultSet.CONCUR_UPDATABLE;\n}","tryCatchPattern":"try {\n    rs.updateTime(\"start_time\", newStart);\n    rs.updateRow();\n} catch (SQLFeatureNotSupportedException e) {\n    // execute UPDATE shifts SET start_time = ? WHERE id = ?\n}","preventionTips":["Perform time adjustments with SQL expressions rather than cursor edits.","Always request CONCUR_READ_ONLY for Presto statements.","Screen ported JDBC code for updateXxx calls before running against Presto.","Encapsulate all writes behind DAO methods that use PreparedStatement."],"tags":["jdbc","sqlfeaturenotsupportedexception","read-only-resultset","presto"],"backgroundTag":"jdbc-updatable-resultset-not-supported","analyzedSha":"55bb57d202de3b926896fa966c2c4a44c779634e","analyzedAt":"2026-09-04T12:50:26.162Z","contentChangedAt":"2026-09-04T12:50:26.162Z","schemaVersion":2},"datasetVersion":"2026-09-11T21:17:09.523Z"}