{"record":{"id":"498b514b5dfd1cd8","repo":"prestodb/presto","slug":"movetoinsertrow","errorCode":null,"errorMessage":"moveToInsertRow","messagePattern":"moveToInsertRow","errorType":"exception","errorClass":"SQLFeatureNotSupportedException","httpStatus":null,"severity":"error","filePath":"presto-jdbc/src/main/java/com/facebook/presto/jdbc/PrestoResultSet.java","lineNumber":1075,"sourceCode":"    @Override\n    public void refreshRow()\n            throws SQLException\n    {\n        throw new SQLFeatureNotSupportedException(\"refreshRow\");\n    }\n\n    @Override\n    public void cancelRowUpdates()\n            throws SQLException\n    {\n        throw new SQLFeatureNotSupportedException(\"cancelRowUpdates\");\n    }\n\n    @Override\n    public void moveToInsertRow()\n            throws SQLException\n    {\n        throw new SQLFeatureNotSupportedException(\"moveToInsertRow\");\n    }\n\n    @Override\n    public void moveToCurrentRow()\n            throws SQLException\n    {\n        throw new SQLFeatureNotSupportedException(\"moveToCurrentRow\");\n    }\n\n    @Override\n    public Statement getStatement()\n    {\n        return statement;\n    }\n\n    @Override\n    public Object getObject(int columnIndex, Map<String, Class<?>> map)\n            throws SQLException","sourceCodeStart":1057,"sourceCodeEnd":1093,"githubUrl":"https://github.com/prestodb/presto/blob/55bb57d202de3b926896fa966c2c4a44c779634e/presto-jdbc/src/main/java/com/facebook/presto/jdbc/PrestoResultSet.java#L1057-L1093","documentation":"moveToInsertRow always throws SQLFeatureNotSupportedException in PrestoResultSet: updatable result sets and insert-row positioning are not supported by the Presto driver, so this JDBC cursor operation is unimplemented.","triggerScenarios":"Calling moveToInsertRow() (usually followed by updateXxx and insertRow) on a ResultSet from a PrestoStatement.","commonSituations":"Legacy JDBC insert-by-cursor code migrated to Presto; ORMs or ETL tools that insert rows via ResultSet; template code copied from MySQL/Oracle examples.","solutions":["Insert data with PreparedStatement INSERT statements instead","Use Presto's INSERT INTO ... VALUES or a connector-appropriate bulk load path","Detect read-only result sets via getConcurrency() and route to the SQL insert path"],"exampleFix":"// before\nrs.moveToInsertRow();\nrs.updateString(\"name\", \"x\");\nrs.insertRow();\nrs.moveToCurrentRow();\n// after\ntry (PreparedStatement ps = conn.prepareStatement(\n        \"INSERT INTO orders (name) VALUES (?)\")) {\n    ps.setString(1, \"x\");\n    ps.executeUpdate();\n}","handlingStrategy":"validation","validationCode":"if (rs.getConcurrency() != ResultSet.CONCUR_UPDATABLE) {\n    // skip moveToInsertRow path; use SQL INSERT\n}","typeGuard":"static boolean supportsInsertRowCursor(ResultSet rs) {\n    try {\n        return rs.getConcurrency() == ResultSet.CONCUR_UPDATABLE;\n    } catch (SQLException e) {\n        return false;\n    }\n}","tryCatchPattern":"try {\n    rs.moveToInsertRow();\n} catch (SQLFeatureNotSupportedException e) {\n    // switch to PreparedStatement INSERT\n}","preventionTips":["Insert via PreparedStatement INSERT statements","Search migrated codebases for moveToInsertRow and refactor them","Verify driver capabilities via DatabaseMetaData before using cursor writes"],"tags":["jdbc","presto","unsupported-feature","sqlfeaturenotsupported"],"backgroundTag":"unsupported-jdbc-feature","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"}