{"record":{"id":"187221f4aea79d57","repo":"prestodb/presto","slug":"updatebyte","errorCode":null,"errorMessage":"updateByte","messagePattern":"updateByte","errorType":"exception","errorClass":"SQLFeatureNotSupportedException","httpStatus":null,"severity":"error","filePath":"presto-jdbc/src/main/java/com/facebook/presto/jdbc/PrestoResultSet.java","lineNumber":788,"sourceCode":"    @Override\n    public void updateNull(int columnIndex)\n            throws SQLException\n    {\n        throw new SQLFeatureNotSupportedException(\"updateNull\");\n    }\n\n    @Override\n    public void updateBoolean(int columnIndex, boolean x)\n            throws SQLException\n    {\n        throw new SQLFeatureNotSupportedException(\"updateBoolean\");\n    }\n\n    @Override\n    public void updateByte(int columnIndex, byte x)\n            throws SQLException\n    {\n        throw new SQLFeatureNotSupportedException(\"updateByte\");\n    }\n\n    @Override\n    public void updateShort(int columnIndex, short x)\n            throws SQLException\n    {\n        throw new SQLFeatureNotSupportedException(\"updateShort\");\n    }\n\n    @Override\n    public void updateInt(int columnIndex, int x)\n            throws SQLException\n    {\n        throw new SQLFeatureNotSupportedException(\"updateInt\");\n    }\n\n    @Override\n    public void updateLong(int columnIndex, long x)","sourceCodeStart":770,"sourceCodeEnd":806,"githubUrl":"https://github.com/prestodb/presto/blob/55bb57d202de3b926896fa966c2c4a44c779634e/presto-jdbc/src/main/java/com/facebook/presto/jdbc/PrestoResultSet.java#L770-L806","documentation":"PrestoResultSet.updateByte(columnIndex, x) is an unimplemented stub that unconditionally throws SQLFeatureNotSupportedException. The Presto JDBC driver supports only read-only result sets, so no in-place cell modification is possible. The method exists solely to satisfy the java.sql.ResultSet interface.","triggerScenarios":"Calling rs.updateByte(i, value) while attempting to edit a row of a Presto ResultSet.","commonSituations":"Code ported from databases with updatable result sets; generic JDBC editors or data-grid components that write values back through the ResultSet.","solutions":["Run an UPDATE statement with setByte parameters instead","Keep result sets CONCUR_READ_ONLY and route all writes through SQL","Detect support via DatabaseMetaData.supportsResultSetConcurrency before attempting updates","Catch SQLFeatureNotSupportedException and surface a clear 'read-only result set' error to users"],"exampleFix":"// before\nrs.updateByte(\"flags\", (byte) 0x01);\nrs.updateRow();\n// after\ntry (PreparedStatement ps = conn.prepareStatement(\"UPDATE t SET flags = ? WHERE id = ?\")) {\n    ps.setByte(1, (byte) 0x01);\n    ps.setLong(2, id);\n    ps.executeUpdate();\n}","handlingStrategy":"validation","validationCode":"DatabaseMetaData md = conn.getMetaData();\nif (!md.supportsResultSetConcurrency(ResultSet.TYPE_FORWARD_ONLY, ResultSet.CONCUR_UPDATABLE)) {\n    // use PreparedStatement UPDATE instead of rs.updateByte\n}","typeGuard":"boolean isUpdatable(ResultSet rs) throws SQLException {\n    return rs.getConcurrency() == ResultSet.CONCUR_UPDATABLE;\n}","tryCatchPattern":"try {\n    rs.updateByte(columnIndex, value);\n} catch (SQLFeatureNotSupportedException e) {\n    // route to SQL UPDATE fallback\n}","preventionTips":["Treat every Presto ResultSet as read-only","Perform byte-level writes via UPDATE ... SET col = ?","Fail fast at connection setup if the app requires updatable result sets","Catch SQLFeatureNotSupportedException centrally in JDBC helper code"],"tags":["jdbc","unsupported-feature","updatable-resultset","sqlfeaturenotsupportedexception"],"backgroundTag":"sqlfeaturenotsupported-unsupported-jdbc-method","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"}