public static final Log LOG = LogFactory.getLog(
DefaultManagerFactory.class.getName());
public ConnManager accept(JobData data) {
SqoopOptions options = data.getSqoopOptions();
String scheme = extractScheme(options);
if (null == scheme) {
// We don't know if this is a mysql://, hsql://, etc.
// Can't do anything with this.
LOG.warn("Null scheme associated with connect string.");
return null;
}
LOG.debug("Trying with scheme: " + scheme);
if (scheme.equals("jdbc:mysql:")) {
if (options.isDirect()) {
return new DirectMySQLManager(options);
} else {
return new MySQLManager(options);
}
} else if (scheme.equals("jdbc:postgresql:")) {
if (options.isDirect()) {
return new DirectPostgresqlManager(options);
} else {
return new PostgresqlManager(options);
}
} else if (scheme.startsWith("jdbc:hsqldb:")) {
return new HsqldbManager(options);
} else if (scheme.startsWith("jdbc:oracle:")) {
return new OracleManager(options);
} else if (scheme.startsWith("jdbc:sqlserver:")) {
return new SQLServerManager(options);
} else if (scheme.startsWith("jdbc:db2:")) {
return new Db2Manager(options);
} else if (scheme.startsWith("jdbc:netezza:")) {
if (options.isDirect()) {
return new DirectNetezzaManager(options);
} else {
return new NetezzaManager(options);
}
} else {