{"record":{"id":"c8d014ee21b1b48d","repo":"prestodb/presto","slug":"getcursorname","errorCode":null,"errorMessage":"getCursorName","messagePattern":"getCursorName","errorType":"exception","errorClass":"SQLFeatureNotSupportedException","httpStatus":null,"severity":"error","filePath":"presto-jdbc/src/main/java/com/facebook/presto/jdbc/PrestoResultSet.java","lineNumber":504,"sourceCode":"            throws SQLException\n    {\n        checkOpen();\n        return warningsManager.getWarnings();\n    }\n\n    @Override\n    public void clearWarnings()\n            throws SQLException\n    {\n        checkOpen();\n        warningsManager.clearWarnings();\n    }\n\n    @Override\n    public String getCursorName()\n            throws SQLException\n    {\n        throw new SQLFeatureNotSupportedException(\"getCursorName\");\n    }\n\n    @Override\n    public ResultSetMetaData getMetaData()\n            throws SQLException\n    {\n        return resultSetMetaData;\n    }\n\n    @Override\n    public Object getObject(int columnIndex)\n            throws SQLException\n    {\n        ColumnInfo columnInfo = columnInfo(columnIndex);\n        switch (columnInfo.getColumnType()) {\n            case Types.DATE:\n                return getDate(columnIndex);\n            case Types.TIME:","sourceCodeStart":486,"sourceCodeEnd":522,"githubUrl":"https://github.com/prestodb/presto/blob/55bb57d202de3b926896fa966c2c4a44c779634e/presto-jdbc/src/main/java/com/facebook/presto/jdbc/PrestoResultSet.java#L486-L522","documentation":"getCursorName is not supported: Presto queries are non-positional, forward-only, unnamed result streams, so there is no cursor name to return. PrestoResultSet throws SQLFeatureNotSupportedException unconditionally. The JDBC cursor-name mechanism (used with positioned UPDATE/DELETE) does not map to Presto's execution model.","triggerScenarios":"Calling rs.getCursorName() on a PrestoResultSet, typically in code that supports updatable-result-set / positioned-update workflows.","commonSituations":"Legacy database middleware that resolves cursor names for positioned DML; framework code probing cursor capabilities on every ResultSet.","solutions":["Remove the getCursorName call — positioned updates via cursor name are impossible in Presto by design","Perform updates with explicit keyed SQL statements (WHERE pk = ?) instead of positioned updates","Check ResultSetMetaData/DatabaseMetaData capabilities before invoking cursor-based APIs"],"exampleFix":"// before\nString cursor = rs.getCursorName();\nstmt.executeUpdate(\"DELETE FROM t WHERE CURRENT OF \" + cursor);\n// after\nstmt.executeUpdate(\"DELETE FROM t WHERE id = ?\", rs.getLong(\"id\")); // use explicit key predicates","handlingStrategy":"try-catch","validationCode":"// positioned updates are impossible in Presto; detect the driver before any cursor-name usage\nif (jdbcUrl.startsWith(\"jdbc:presto:\")) {\n    throw new UnsupportedOperationException(\"Cursor names / positioned updates are not supported by Presto\");\n}","typeGuard":null,"tryCatchPattern":"try {\n    String cursor = rs.getCursorName();\n} catch (SQLFeatureNotSupportedException e) {\n    // fall back to explicit keyed UPDATE/DELETE statements\n}","preventionTips":["Never use positioned UPDATE/DELETE (CURRENT OF) with Presto","Always issue updates with explicit primary-key predicates","Probe capabilities via DatabaseMetaData rather than assuming JDBC feature parity"],"tags":["jdbc","presto","unsupported-operation","cursor"],"backgroundTag":"jdbc-feature-not-supported","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"}