{"record":{"id":"5330d472ca32e0dc","repo":"apache/shardingsphere","slug":"updatebyte","errorCode":null,"errorMessage":"updateByte","messagePattern":"updateByte","errorType":"exception","errorClass":"SQLFeatureNotSupportedException","httpStatus":null,"severity":"error","filePath":"kernel/sql-federation/core/src/main/java/org/apache/shardingsphere/sqlfederation/resultset/AbstractUnsupportedUpdateOperationSQLFederationResultSet.java","lineNumber":64,"sourceCode":"    \n    @Override\n    public final void updateNull(final String columnLabel) throws SQLException {\n        throw new SQLFeatureNotSupportedException(\"updateNull\");\n    }\n    \n    @Override\n    public final void updateBoolean(final int columnIndex, final boolean x) throws SQLException {\n        throw new SQLFeatureNotSupportedException(\"updateBoolean\");\n    }\n    \n    @Override\n    public final void updateBoolean(final String columnLabel, final boolean x) throws SQLException {\n        throw new SQLFeatureNotSupportedException(\"updateBoolean\");\n    }\n    \n    @Override\n    public final void updateByte(final int columnIndex, final byte x) throws SQLException {\n        throw new SQLFeatureNotSupportedException(\"updateByte\");\n    }\n    \n    @Override\n    public final void updateByte(final String columnLabel, final byte x) throws SQLException {\n        throw new SQLFeatureNotSupportedException(\"updateByte\");\n    }\n    \n    @Override\n    public final void updateShort(final int columnIndex, final short x) throws SQLException {\n        throw new SQLFeatureNotSupportedException(\"updateShort\");\n    }\n    \n    @Override\n    public final void updateShort(final String columnLabel, final short x) throws SQLException {\n        throw new SQLFeatureNotSupportedException(\"updateShort\");\n    }\n    \n    @Override","sourceCodeStart":46,"sourceCodeEnd":82,"githubUrl":"https://github.com/apache/shardingsphere/blob/e952770a215630a3659c75d64369168cd3e26b82/kernel/sql-federation/core/src/main/java/org/apache/shardingsphere/sqlfederation/resultset/AbstractUnsupportedUpdateOperationSQLFederationResultSet.java#L46-L82","documentation":"updateByte(int, byte) is another member of the JDBC in-place row-update API that the ShardingSphere federation ResultSet intentionally omits. The final method unconditionally throws SQLFeatureNotSupportedException since federated result rows cannot be written back.","triggerScenarios":"Calling ResultSet.updateByte(columnIndex, (byte) x) on a federation ResultSet — editing a TINYINT/small-integer column client-side via the updatable-ResultSet protocol.","commonSituations":"Generic JDBC table editors that iterate updateXXX overloads matched to column types; ORM rowset implementations; code written against MySQL/Oracle updatable cursors reused under federation.","solutions":["Replace with an UPDATE statement binding the byte value to a PreparedStatement parameter.","Check getConcurrency() before attempting any updateXXX call; treat CONCUR_READ_ONLY as 'use SQL updates'.","Move such editing flows to a non-federated datasource or disable federation for those statements.","Encapsulate all writes in one data-access layer so unsupported client-side updates cannot appear."],"exampleFix":"// before\nresultSet.updateByte(4, (byte) 9);\nresultSet.updateRow();\n\n// after\n// UPDATE item SET qty = ? WHERE id = ?","handlingStrategy":"validation","validationCode":"if (resultSet.getConcurrency() != ResultSet.CONCUR_UPDATABLE) { /* issue UPDATE with parameter binding */ }","typeGuard":"boolean isUpdatable(ResultSet rs) throws SQLException { return rs.getConcurrency() == ResultSet.CONCUR_UPDATABLE; }","tryCatchPattern":"try { rs.updateByte(4, (byte) 9); rs.updateRow(); } catch (SQLFeatureNotSupportedException e) { /* UPDATE item SET qty = ? WHERE id = ? */ }","preventionTips":["Avoid type-dispatched updateXXX utilities against federation results.","Persist numeric edits through prepared UPDATE statements.","Mark federation datasources as read-only for editing tools."],"tags":["jdbc","sql-federation","resultset","unsupported-operation","readonly","updatable-resultset"],"backgroundTag":null,"analyzedSha":"e952770a215630a3659c75d64369168cd3e26b82","analyzedAt":"2026-08-14T13:54:53.392Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}