{"record":{"id":"18cffba2c1a5e620","repo":"apache/shardingsphere","slug":"updateshort","errorCode":null,"errorMessage":"updateShort","messagePattern":"updateShort","errorType":"exception","errorClass":"SQLFeatureNotSupportedException","httpStatus":null,"severity":"error","filePath":"kernel/sql-federation/core/src/main/java/org/apache/shardingsphere/sqlfederation/resultset/AbstractUnsupportedUpdateOperationSQLFederationResultSet.java","lineNumber":74,"sourceCode":"    \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\n    public final void updateInt(final int columnIndex, final int x) throws SQLException {\n        throw new SQLFeatureNotSupportedException(\"updateInt\");\n    }\n    \n    @Override\n    public final void updateInt(final String columnLabel, final int x) throws SQLException {\n        throw new SQLFeatureNotSupportedException(\"updateInt\");\n    }\n    \n    @Override","sourceCodeStart":56,"sourceCodeEnd":92,"githubUrl":"https://github.com/apache/shardingsphere/blob/e952770a215630a3659c75d64369168cd3e26b82/kernel/sql-federation/core/src/main/java/org/apache/shardingsphere/sqlfederation/resultset/AbstractUnsupportedUpdateOperationSQLFederationResultSet.java#L56-L92","documentation":"updateShort(int, short) is part of the row-update API that AbstractUnsupportedUpdateOperationSQLFederationResultSet blocks by design. ShardingSphere federation computes results in memory and offers no writable cursor, so the final method always throws SQLFeatureNotSupportedException.","triggerScenarios":"Calling ResultSet.updateShort(columnIndex, (short) v) (typically before updateRow()) on a federation ResultSet — an in-place edit of a SMALLINT-typed column.","commonSituations":"Framework code that maps JDBC TINYINT/SMALLINT metadata to updateShort; editable grid tools; porting desktop/JDBC-swing applications onto a sharded federation datasource.","solutions":["Persist with an UPDATE statement using a PreparedStatement parameter for the short value.","Treat CONCUR_READ_ONLY ResultSets as non-editable and take the SQL-update path automatically.","Route statements used for interactive editing away from federation.","Audit shared DAO code for any updateXXX( usage as part of the federation migration checklist."],"exampleFix":"// before\nresultSet.updateShort(2, (short) 42);\nresultSet.updateRow();\n\n// after\n// UPDATE sensor SET threshold = ? WHERE id = ?","handlingStrategy":"validation","validationCode":"if (resultSet.getConcurrency() != ResultSet.CONCUR_UPDATABLE) { /* use UPDATE SQL */ }","typeGuard":"boolean isUpdatable(ResultSet rs) throws SQLException { return rs.getConcurrency() == ResultSet.CONCUR_UPDATABLE; }","tryCatchPattern":"try { rs.updateShort(2, (short) 42); rs.updateRow(); } catch (SQLFeatureNotSupportedException e) { /* UPDATE sensor SET threshold = ? WHERE id = ? */ }","preventionTips":["Persist SMALLINT changes with UPDATE statements.","Probe concurrency mode once and cache the editing strategy per datasource.","Include edit-path tests when enabling sql-federation."],"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-15T22:17:37.221Z"}