xiebin
2026-02-09 bf4bf0e15922961be005bbf6693cf306e18d327c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
package cn.net.communion.dbdatasync.dbhelper;
 
import cn.net.communion.dbdatasync.dbhelper.impl.MySql;
import cn.net.communion.dbdatasync.dbhelper.impl.PostgreSql;
import cn.net.communion.dbdatasync.dbhelper.impl.SqlServer;
 
public class Factory {
    public static DbHelper create(String dbType) {
        switch (dbType.toLowerCase()) {
            case "mysql":
                return new MySql();
            case "postgresql":
                return new PostgreSql();
            default:
                throw new IllegalArgumentException("Unsupported database type: " + dbType);
        }
    }
}