{"record":{"id":"d0b237c1c6d37489","repo":"apache/seatunnel","slug":"database-not-existed-d0b237","errorCode":"DATABASE_NOT_EXISTED","errorMessage":"Database %s does not exist in Catalog %s.","messagePattern":"Database (.+?) does not exist in Catalog (.+?)\\.","errorType":"error_code","errorClass":"DatabaseNotExistException","httpStatus":null,"severity":"error","filePath":"seatunnel-connectors-v2/connector-jdbc/src/main/java/org/apache/seatunnel/connectors/seatunnel/jdbc/catalog/dm/DamengCatalog.java","lineNumber":202,"sourceCode":"                        .build();\n        return DmdbTypeConverter.INSTANCE.convert(typeDefine);\n    }\n\n    @Override\n    protected String getUrlFromDatabaseName(String databaseName) {\n        return defaultUrl;\n    }\n\n    @Override\n    protected String getOptionTableName(TablePath tablePath) {\n        return tablePath.getSchemaAndTableName();\n    }\n\n    @Override\n    public List<String> listTables(String databaseName)\n            throws CatalogException, DatabaseNotExistException {\n        if (!databaseExists(databaseName)) {\n            throw new DatabaseNotExistException(this.catalogName, databaseName);\n        }\n\n        try (PreparedStatement ps =\n                        getConnection(defaultUrl)\n                                .prepareStatement(\"SELECT OWNER, TABLE_NAME FROM ALL_TABLES\");\n                ResultSet rs = ps.executeQuery()) {\n\n            List<String> tables = new ArrayList<>();\n            while (rs.next()) {\n                tables.add(rs.getString(1) + \".\" + rs.getString(2));\n            }\n\n            return tables;\n        } catch (Exception e) {\n            throw new CatalogException(\n                    String.format(\"Failed listing table in catalog %s\", catalogName), e);\n        }\n    }","sourceCodeStart":184,"sourceCodeEnd":220,"githubUrl":"https://github.com/apache/seatunnel/blob/cf67b549a7a6c35fa0beb12d83c62892427ea919/seatunnel-connectors-v2/connector-jdbc/src/main/java/org/apache/seatunnel/connectors/seatunnel/jdbc/catalog/dm/DamengCatalog.java#L184-L220","documentation":"DamengCatalog.listTables first verifies the database (schema) exists; if not, it throws DatabaseNotExistException (a typed CatalogException with code DATABASE_NOT_EXISTED) with message 'Database <db> does not exist in Catalog <catalog>'. This is a precondition check before querying ALL_TABLES.","triggerScenarios":"Calling listTables(databaseName) with a databaseName that does not match any existing Dameng schema, including wrong-case names (Dameng identifiers are case-sensitive when quoted) or the default schema not being initialized.","commonSituations":"Configuring schema/database names with wrong casing; pointing the catalog at a fresh Dameng instance where the schema was never created; confusing database vs schema concepts in Dameng.","solutions":["Create the schema in Dameng before calling listTables (or before running the job)","Match identifier casing exactly (check what SHOW/SELECT returns from Dameng; quoted names are case-sensitive)","Verify the connection/defaultUrl points to the intended Dameng instance","Catch DatabaseNotExistException and create the schema or fail fast with a clear message"],"exampleFix":"// before\nList<String> tables = catalog.listTables(\"MySchema\"); // DatabaseNotExistException\n// after\nString schema = catalog.listDatabases().stream()\n        .filter(d -> d.equalsIgnoreCase(\"MySchema\"))\n        .findFirst()\n        .orElseThrow(() -> new IllegalStateException(\"Create schema in Dameng first\"));\nList<String> tables = catalog.listTables(schema);","handlingStrategy":"validation","validationCode":"// Java\nboolean exists = catalog.listDatabases().stream()\n        .anyMatch(d -> d.equals(databaseName)); // exact-case match\nif (!exists) { throw new IllegalStateException(\"Schema missing in Dameng: \" + databaseName); }","typeGuard":null,"tryCatchPattern":"// Java\ntry {\n    return catalog.listTables(databaseName);\n} catch (DatabaseNotExistException e) {\n    LOG.error(\"Schema {} does not exist in {}; create it first\", databaseName, e.getCatalogName());\n    throw e;\n}","preventionTips":["Create the schema in Dameng before listing tables or running jobs","Use exact identifier casing — quoted Dameng identifiers are case-sensitive","Confirm the JDBC URL points at the intended instance before debugging 'not exist' errors"],"tags":["jdbc","dameng","database-not-exist"],"backgroundTag":"resource-not-found","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"}