Add the real implementation

This commit is contained in:
Derry Hamilton 2023-07-12 08:45:48 +01:00
parent 1b1ba551c8
commit 9a8716f33e

View file

@ -105,14 +105,14 @@ public class CopyingApp {
log.info(String.format("%s - Setting Row count interval to default of 100 rows.",jobName));
}
Integer pollTimeout = null;
try {
pollTimeout = new Integer(config.getString("pollTimeout"));
log.info(String.format("%s - Setting Poll timeout to %s milliseconds", jobName, pollTimeout));
} catch(Exception e) {
pollTimeout = new Integer(1000); // If we don't have a new setting, use the old default
log.info(String.format("%s - Setting poll timeout to default of 1 second.",jobName));
}
Integer pollTimeout = null;
try {
pollTimeout = new Integer(config.getString("pollTimeout"));
log.info(String.format("%s - Setting Poll timeout to %s milliseconds", jobName, pollTimeout));
} catch(Exception e) {
pollTimeout = new Integer(1000); // If we don't have a new setting, use the old default
log.info(String.format("%s - Setting poll timeout to default of 1 second.",jobName));
}
@ -148,7 +148,7 @@ public class CopyingApp {
pollTimeout,
identifySourceSQL,
identifyDestinationSQL
);
);
j.start();
j.join();
@ -179,7 +179,7 @@ public class CopyingApp {
pollTimeout,
identifySourceSQL,
identifyDestinationSQL
);
);
j.start();
j.join();
} else {
@ -242,10 +242,20 @@ public class CopyingApp {
return c;
}
private void loadDrivers(Configuration config){
// Even with JDBC 4, some drivers don't play nicely with whatever
// the classloaders are up to. So this allows us to force it the
// old fashioned way, and works around the
// "But it works fine when it's the /only/ driver!"
// cross-database problem
private void loadDrivers(Configuration config) {
String[] drivers = config.get(String[].class, "drivers.driver");
for(String d:drivers){
log.info("Would load "+d);
for(String d:drivers) {
try {
Class.forName(d);
log.info("Preloaded driver "+d);
} catch(ClassNotFoundException e) {
log.error("Could not preload driver "+d,e);
}
}
}
}