public static SOSConnection getSchedulerConnection(SOSSettings schedulerSettings, SOSLogger log) throws Exception {
String dbProperty = schedulerSettings.getSection("spooler").getProperty("db").replaceAll("jdbc:", "-url=jdbc:");
dbProperty = dbProperty.substring(dbProperty.indexOf('-'));
if (dbProperty.endsWith("-password="))
dbProperty = dbProperty.substring(0, dbProperty.length() - 10);
SOSArguments arguments = new SOSArguments(dbProperty);
SOSConnection conn;
if (log != null) {
conn = SOSConnection.createInstance(schedulerSettings.getSection("spooler").getProperty("db_class"), arguments.as_string("-class=", ""),
arguments.as_string("-url=", ""), arguments.as_string("-user=", ""), arguments.as_string("-password=", ""), log);
}
else {
conn = SOSConnection.createInstance(schedulerSettings.getSection("spooler").getProperty("db_class"), arguments.as_string("-class=", ""),
arguments.as_string("-url=", ""), arguments.as_string("-user=", ""), arguments.as_string("-password=", ""));
}
return conn;
}