public boolean spooler_init() {
ArrayList references = null;
try {
this.setLogger(new SOSSchedulerLogger(this.spooler.log()));
try { // to initialize database connection
this.setJobSettings(new SOSProfileSettings(spooler.ini_path()));
this.setJobProperties(this.jobSettings.getSection("spooler"));
if (this.getJobProperties().isEmpty())
throw new Exception("no settings found in section [spooler] of configuration file: " + spooler.ini_path());
if (this.getJobProperties().getProperty("db") == null || this.getJobProperties().getProperty("db").length() == 0)
throw new Exception("no settings found for entry [db] in section [spooler] of configuration file: " + spooler.ini_path());
if (this.getJobProperties().getProperty("db_class") == null || this.getJobProperties().getProperty("db_class").length() == 0)
throw new Exception("no settings found for entry [db_class] in section [spooler] of configuration file: " + spooler.ini_path());
if (this.getLogger() != null) sosLogger.debug6("connecting to database.. .");
String dbProperty = this.getJobProperties().getProperty("db").replaceAll("jdbc:", "-url=jdbc:");
dbProperty = dbProperty.substring(dbProperty.indexOf('-'));
SOSArguments arguments = new SOSArguments(dbProperty);
this.setConnection( SOSConnection.createInstance(
this.getJobProperties().getProperty("db_class"),
arguments.as_string("-class=", ""),
arguments.as_string("-url=", ""),
arguments.as_string("-user=", ""),
arguments.as_string("-password=", ""),
(SOSLogger)new SOSSchedulerLogger(this.spooler_log) )
);
this.getConnection().connect();
if (this.getLogger() != null) this.getLogger().debug6("..successfully connected to " + arguments.as_string("-url=", ""));
}