{"record":{"id":"a277e332ef70223e","repo":"prestodb/presto","slug":"rowinserted","errorCode":null,"errorMessage":"rowInserted","messagePattern":"rowInserted","errorType":"exception","errorClass":"SQLFeatureNotSupportedException","httpStatus":null,"severity":"info","filePath":"presto-jdbc/src/main/java/com/facebook/presto/jdbc/PrestoResultSet.java","lineNumber":760,"sourceCode":"    public int getConcurrency()\n            throws SQLException\n    {\n        checkOpen();\n        return CONCUR_READ_ONLY;\n    }\n\n    @Override\n    public boolean rowUpdated()\n            throws SQLException\n    {\n        throw new SQLFeatureNotSupportedException(\"rowUpdated\");\n    }\n\n    @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)","sourceCodeStart":742,"sourceCodeEnd":778,"githubUrl":"https://github.com/prestodb/presto/blob/55bb57d202de3b926896fa966c2c4a44c779634e/presto-jdbc/src/main/java/com/facebook/presto/jdbc/PrestoResultSet.java#L742-L778","documentation":"PrestoResultSet.rowInserted() is an unimplemented JDBC 4.x ResultSet method. The Presto JDBC driver only supports forward-only, read-only result sets, so all row-visibility and updatable-resultset methods throw SQLFeatureNotSupportedException with the method name as the message. There is no code path that returns normally from this method.","triggerScenarios":"Calling rs.rowInserted() on any ResultSet obtained from a PrestoStatement or PrestoConnection, regardless of fetch direction, concurrency, or result contents.","commonSituations":"Generic JDBC framework code (ORMs, report tools, migration frameworks) that probes result-set capabilities or detects visible row updates on every ResultSet; running such a framework against Presto where it would use an updatable ResultSet against another database.","solutions":["Do not call rowInserted(); Presto result sets are read-only, so a row cannot have been inserted into them","Check DatabaseMetaData.deletesAreDetected/insertsAreDetected (they report false for Presto) and skip visibility checks when they return false","If you need insert feedback, run an INSERT statement and check its update count instead of probing the ResultSet","Wrap generic JDBC code so these calls are only made when the result set was created with CONCUR_UPDATABLE, which Presto never supports"],"exampleFix":"// before\nif (rs.rowInserted()) { handleInsert(); }\n// after\nDatabaseMetaData md = rs.getStatement().getConnection().getMetaData();\nif (md.insertsAreDetected(ResultSet.TYPE_FORWARD_ONLY) && rs.rowInserted()) { handleInsert(); }","handlingStrategy":"try-catch","validationCode":"DatabaseMetaData md = conn.getMetaData();\nboolean supported = md.insertsAreDetected(ResultSet.TYPE_FORWARD_ONLY); // false for Presto\nif (!supported) { /* skip rowInserted() */ }","typeGuard":"boolean supportsInsertDetection(Connection c) {\n    try { return c.getMetaData().insertsAreDetected(ResultSet.TYPE_FORWARD_ONLY); }\n    catch (SQLException e) { return false; }\n}","tryCatchPattern":"try {\n    if (rs.rowInserted()) { /* ... */ }\n} catch (SQLFeatureNotSupportedException e) {\n    // read-only driver: treat as not inserted\n}","preventionTips":["Never call row-visibility methods (rowInserted/rowUpdated/rowDeleted) on Presto result sets","Consult DatabaseMetaData.deletesAreDetected/insertsAreDetected before using visibility APIs","Treat all Presto result sets as forward-only, read-only","Use INSERT update counts for insert feedback instead"],"tags":["jdbc","unsupported-feature","sqlfeaturenotsupportedexception","read-only-resultset"],"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"}