{"record":{"id":"905bb54250391bdc","repo":"MyCATApache/Mycat-Server","slug":"dbtype-dbtype-is-not-support-for-the-moment","errorCode":null,"errorMessage":"dbType:{dbType} is not support for the moment!","messagePattern":"dbType:(.+?) is not support for the moment!","errorType":"exception","errorClass":"DataMigratorException","httpStatus":null,"severity":"error","filePath":"src/main/java/io/mycat/util/dataMigrator/DataIOFactory.java","lineNumber":16,"sourceCode":"package io.mycat.util.dataMigrator;\r\n\r\nimport io.mycat.util.dataMigrator.dataIOImpl.MysqlDataIO;\r\nimport io.mycat.util.exception.DataMigratorException;\r\n\r\npublic class DataIOFactory {\r\n\r\n\tpublic static final String MYSQL = \"mysql\";\r\n\tpublic static final String ORACLE = \"oracle\";\r\n\t\r\n\tpublic static DataIO createDataIO(String dbType){\r\n\t\tswitch (dbType) {\r\n\t\tcase MYSQL:\r\n\t\t\treturn new MysqlDataIO();\r\n\t\tdefault:\r\n\t\t\tthrow new DataMigratorException(\"dbType:\"+dbType+\" is not support for the moment!\");\r\n\t\t}\r\n\t}\r\n}\r\n","sourceCodeStart":1,"sourceCodeEnd":20,"githubUrl":"https://github.com/MyCATApache/Mycat-Server/blob/65f8d8beb752f935752f2a0eec0ab017facab9ef/src/main/java/io/mycat/util/dataMigrator/DataIOFactory.java#L1-L20","documentation":"DataIOFactory.createDataIO is the factory for database IO adapters in the migration tool. Only MySQL (DataMigratorUtil MYSQL constant) is supported; any other dbType string falls through to default and throws a DataMigratorException. MyCat's data migrator simply has no adapter for other databases.","triggerScenarios":"Calling DataIOFactory.createDataIO with a dbType other than the supported \"mysql\" constant — e.g. \"MySQL\" with different case, \"oracle\", \"postgresql\", or null.","commonSituations":"Extending the migrator to another RDBMS; passing a dbType read from config with different casing; wiring the migrator against an Oracle/PostgreSQL source cluster.","solutions":["Pass exactly the MYSQL constant value (\"mysql\") as defined in DataMigratorUtil, matching case.","If migrating from another database, export the data to MySQL first or implement a DataIO adapter for that dbType and add a case to the factory.","Check where dbType originates (config file/CLI arg) and correct it.","Log/inspect the received dbType value to spot casing or null issues."],"exampleFix":"// before\nDataIO io = DataIOFactory.createDataIO(\"MySQL\");\n// after\nDataIO io = DataIOFactory.createDataIO(\"mysql\");","handlingStrategy":"validation","validationCode":"String dbType = config.getDbType();\nif (!\"mysql\".equals(dbType == null ? null : dbType.toLowerCase())) {\n    throw new IllegalArgumentException(\"data migrator supports only mysql, got: \" + dbType);\n}\nDataIO io = DataIOFactory.createDataIO(\"mysql\");","typeGuard":null,"tryCatchPattern":"try {\n    DataIO io = DataIOFactory.createDataIO(dbType);\n} catch (DataMigratorException e) {\n    if (e.getMessage().contains(\"not support for the moment\")) {\n        // normalize dbType to \"mysql\" or implement a DataIO adapter\n    }\n    throw e;\n}","preventionTips":["Pass the DataMigratorUtil.MYSQL constant instead of a raw string literal","Normalize dbType from config/CLI to lowercase before calling the factory","Document that the migrator is MySQL-only when extending tooling"],"tags":["java","data-migration","factory","unsupported-database"],"backgroundTag":"unsupported-enum-value","analyzedSha":"65f8d8beb752f935752f2a0eec0ab017facab9ef","analyzedAt":"2026-09-11T00:12:21.696Z","contentChangedAt":"2026-09-11T00:12:21.696Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}