{"record":{"id":"3d54fcc91a9eb7e5","repo":"apache/seatunnel","slug":"failed-to-querysqlresult-3d54fc","errorCode":null,"errorMessage":"Failed to querySQLResult","messagePattern":"Failed to querySQLResult","errorType":"exception","errorClass":"SeaTunnelException","httpStatus":null,"severity":"error","filePath":"seatunnel-connectors-v2/connector-jdbc/src/main/java/org/apache/seatunnel/connectors/seatunnel/jdbc/catalog/oceanbase/OceanBaseOracleCatalog.java","lineNumber":63,"sourceCode":"\n    @Override\n    protected String getListDatabaseSql() {\n        throw new UnsupportedOperationException();\n    }\n\n    @Override\n    protected String getDatabaseWithConditionSql(String databaseName) {\n        throw new UnsupportedOperationException();\n    }\n\n    @Override\n    public boolean tableExists(TablePath tablePath) throws CatalogException {\n        try {\n            return querySQLResultExists(\n                    this.getUrlFromDatabaseName(tablePath.getDatabaseName()),\n                    getTableWithConditionSql(tablePath));\n        } catch (SQLException e) {\n            throw new SeaTunnelException(\"Failed to querySQLResult\", e);\n        }\n    }\n\n    @Override\n    public List<String> listTables(String databaseName)\n            throws CatalogException, DatabaseNotExistException {\n        String dbUrl = getUrlFromDatabaseName(databaseName);\n        try {\n            return queryString(dbUrl, getListTableSql(databaseName), this::getTableName);\n        } catch (Exception e) {\n            throw new CatalogException(\n                    String.format(\"Failed listing database in catalog %s\", catalogName), e);\n        }\n    }\n\n    @Override\n    public void createTable(\n            TablePath tablePath, CatalogTable table, boolean ignoreIfExists, boolean createIndex)","sourceCodeStart":45,"sourceCodeEnd":81,"githubUrl":"https://github.com/apache/seatunnel/blob/cf67b549a7a6c35fa0beb12d83c62892427ea919/seatunnel-connectors-v2/connector-jdbc/src/main/java/org/apache/seatunnel/connectors/seatunnel/jdbc/catalog/oceanbase/OceanBaseOracleCatalog.java#L45-L81","documentation":"OceanBaseOracleCatalog.tableExists wraps SQLException from querying the table-existence SQL into SeaTunnelException(\"Failed to querySQLResult\"). It indicates the metadata probe query against the OceanBase Oracle tenant failed (connectivity, SQL error, bad URL mapping), not that the table is missing.","triggerScenarios":"tableExists(TablePath) executing getTableWithConditionSql via querySQLResultExists when the JDBC connection fails or the query errors; also triggered indirectly by createTable, which calls tableExists first.","commonSituations":"Wrong tenant/username/password, unreachable OceanBase OBProxy, malformed URL returned by getUrlFromDatabaseName, network/firewall issues.","solutions":["Verify JDBC connectivity with the same URL/credentials using a SQL client","Check getUrlFromDatabaseName output for the table's database name is a valid Oracle-thin URL","Inspect the chained SQLException cause for the real error (ORA- code)","Enable connection retry/timeout tuning for unstable networks"],"exampleFix":"// before\ntry { catalog.tableExists(path); } catch (Exception e) { /* opaque */ }\n// after\ntry { catalog.tableExists(path); } catch (SeaTunnelException e) {\n    log.error(\"tableExists failed: {}\", e.getCause(), e); // inspect SQLException cause\n}","handlingStrategy":"try-catch","validationCode":"// pre-check connectivity\ntry (Connection c = DriverManager.getConnection(url, user, pwd)) { c.isValid(5); }","typeGuard":null,"tryCatchPattern":"try { catalog.tableExists(path); } catch (SeaTunnelException e) { Throwable cause = e.getCause(); /* SQLException — inspect and decide retry vs config fix */ }","preventionTips":["Validate the JDBC URL and credentials before catalog operations","Ensure OBProxy/host:port is reachable and firewalls allow the port","Use a stable username@tenant and test with a SQL client first"],"tags":["jdbc","oceanbase","sql","connectivity"],"backgroundTag":"sql-query-failed","analyzedSha":"cf67b549a7a6c35fa0beb12d83c62892427ea919","analyzedAt":"2026-09-10T21:44:55.265Z","contentChangedAt":"2026-09-10T21:44:55.265Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}