ConfigLoader<BootstrapReadOnlyConfig> configLoad =
new ConfigLoader<BootstrapReadOnlyConfig>("databus.bootstrap.", cfgBuilder);
configLoad.loadConfig(cfgProps);
BootstrapReadOnlyConfig cfg = cfgBuilder.build();
BootstrapConn conn = new BootstrapConn();
try
{
conn.initBootstrapConn(true, cfg.getBootstrapDBUsername(), cfg.getBootstrapDBPassword(),
cfg.getBootstrapDBHostname(), cfg.getBootstrapDBName());
BootstrapDBMetaDataDAO dao = new BootstrapDBMetaDataDAO(conn,
cfg.getBootstrapDBHostname(),
cfg.getBootstrapDBUsername(),
cfg.getBootstrapDBPassword(),
cfg.getBootstrapDBName(),
false);
switch (cli.getAction())
{
case CREATE_LOG_TABLE: dao.createNewLogTable(cli.getSrcId()); break;
case CREATE_TAB_TABLE: dao.createNewSrcTable(cli.getSrcId()); break;
default: throw new RuntimeException("unknown action: " + cli.getAction());
}
}
finally
{
conn.close();
}
}