props.load(in);
}
// create main database
s_logger.info("Creating main database...");
DbTool dbTool = new DbTool();
dbTool.setJdbcUrl(Objects.requireNonNull(props.getProperty(KEY_SHARED_URL)));
dbTool.setUser(props.getProperty(KEY_SHARED_USER_NAME, ""));
dbTool.setPassword(props.getProperty(KEY_SHARED_PASSWORD, ""));
dbTool.setCatalog(CATALOG); // ignored, as it is parsed from the url
dbTool.setCreate(true);
dbTool.setDrop(true);
dbTool.setCreateTables(true);
dbTool.execute();
// create user database
s_logger.info("Creating user database...");
DbTool dbToolUser = new DbTool();
dbToolUser.setJdbcUrl(Objects.requireNonNull(props.getProperty(KEY_USERFINANCIAL_URL)));
dbToolUser.setUser(props.getProperty(KEY_USERFINANCIAL_USER_NAME, ""));
dbToolUser.setPassword(props.getProperty(KEY_USERFINANCIAL_PASSWORD, ""));
dbToolUser.setCatalog(CATALOG); // ignored, as it is parsed from the url
dbToolUser.setCreate(true);
dbToolUser.setDrop(true);
dbToolUser.setCreateTables(true);
dbToolUser.execute();
// populate the database
s_logger.info("Populating main database...");
ServerDatabasePopulator populator = new ServerDatabasePopulator(_configFile, new DatabasePopulatorTool(_serverUrl));
populator.run();