import net.jaekl.cfb.analyze.Analyzer;
import net.jaekl.cfb.analyze.MessageMap;
import net.jaekl.cfb.db.CfbSchema;
+import net.jaekl.cfb.db.TypeMismatchException;
import net.jaekl.cfb.db.driver.DbDriver;
import net.jaekl.cfb.db.driver.PostgresqlDriver;
import net.jaekl.cfb.store.DbStore;
}
}
- void doMain(PrintWriter pw, String[] args) throws SQLException, IOException, XmlParseException, SAXException {
+ void doMain(PrintWriter pw, String[] args) throws SQLException, IOException, XmlParseException, SAXException, TypeMismatchException {
initArgs(); // read environment and system properties
if ( ! parseArgs(pw, args) ) {
return;
m_schema.purge(con);
return;
}
- m_schema.ensureDbInitialized(con);
+ m_schema.ensureDbInitialized(con);
+ messageMap.loadIds(con, m_driver);
}
catch (SQLException exc) {
reportUnableToConnect(pw, exc);
}
try (Connection con = m_driver.connect(m_host, m_port, m_dbName, m_user, m_pass)) {
- DbStore store = new DbStore(con);
+ DbStore store = new DbStore(con, m_driver, messageMap.getColl());
store.put(analysis);
}
String cannotConnectFormat = trans(CfbBundle.CANNOT_CONNECT);
String cannotConnect = MessageFormat.format(cannotConnectFormat, m_host, ""+m_port, m_dbName, m_user);
exc.printStackTrace(pw);
+ SQLException next = exc.getNextException();
+ while (null != next) {
+ next.printStackTrace(pw);
+ next = next.getNextException();
+ }
pw.println(cannotConnect);
}
try (PrintWriter pw = new PrintWriter(System.out)){
cfb.doMain(pw, args);
pw.flush();
- } catch (SQLException | IOException | XmlParseException | SAXException exc) {
+ } catch (SQLException | IOException | XmlParseException | SAXException | TypeMismatchException exc) {
exc.printStackTrace();
}
}