{"record":{"id":"3a8565736c1756f1","repo":"prestodb/presto","slug":"updatenull","errorCode":null,"errorMessage":"updateNull","messagePattern":"updateNull","errorType":"exception","errorClass":"SQLFeatureNotSupportedException","httpStatus":null,"severity":"error","filePath":"presto-jdbc/src/main/java/com/facebook/presto/jdbc/PrestoResultSet.java","lineNumber":774,"sourceCode":"    @Override\n    public boolean rowInserted()\n            throws SQLException\n    {\n        throw new SQLFeatureNotSupportedException(\"rowInserted\");\n    }\n\n    @Override\n    public boolean rowDeleted()\n            throws SQLException\n    {\n        throw new SQLFeatureNotSupportedException(\"rowDeleted\");\n    }\n\n    @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)","sourceCodeStart":756,"sourceCodeEnd":792,"githubUrl":"https://github.com/prestodb/presto/blob/55bb57d202de3b926896fa966c2c4a44c779634e/presto-jdbc/src/main/java/com/facebook/presto/jdbc/PrestoResultSet.java#L756-L792","documentation":"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.","triggerScenarios":"Calling rs.updateNull(i) on a ResultSet, typically as part of building an in-place row update before rs.updateRow() or insertRow().","commonSituations":"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.","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"],"exampleFix":"// before\nrs.updateNull(\"notes\");\nrs.updateRow();\n// after\ntry (PreparedStatement ps = conn.prepareStatement(\"UPDATE t SET notes = NULL WHERE id = ?\")) {\n    ps.setLong(1, id);\n    ps.executeUpdate();\n}","handlingStrategy":"validation","validationCode":"DatabaseMetaData md = conn.getMetaData();\nif (!md.supportsResultSetConcurrency(ResultSet.TYPE_FORWARD_ONLY, ResultSet.CONCUR_UPDATABLE)) {\n    throw new IllegalStateException(\"Driver does not support updatable result sets; use SQL UPDATE\");\n}","typeGuard":"boolean isUpdatable(ResultSet rs) throws SQLException {\n    return rs.getConcurrency() == ResultSet.CONCUR_UPDATABLE;\n}","tryCatchPattern":"try {\n    rs.updateNull(columnIndex);\n} catch (SQLFeatureNotSupportedException e) {\n    // fall back to: UPDATE t SET col = NULL WHERE key = ?\n}","preventionTips":["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"],"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"}