class DataSourceFactory {

    public DataSourceWrapper newInstance(final ScalingDataSourceConfiguration dataSourceConfig) {
        if (dataSourceConfig instanceof JDBCScalingDataSourceConfiguration) {
            return newInstanceDataSourceByJDBC((JDBCScalingDataSourceConfiguration) dataSourceConfig);
        } else if (dataSourceConfig instanceof ShardingSphereJDBCScalingDataSourceConfiguration) {
            return newInstanceDataSourceByShardingSphereJDBC((ShardingSphereJDBCScalingDataSourceConfiguration) dataSourceConfig);
        }
        throw new UnsupportedOperationException("Unsupported data source configuration");
    }

}