public static boolean insertLog(LoggerBean loggerBean) {

      boolean good = true;

      try {
         ResultSet rset = null;
         PreparedStatement stmt = null;

         String statementName = "insertLog";
         SQLConnManager connMgr = new SQLConnManager(statementName, new ErrorBean());

         try {
            // Get database connection
            if ((connMgr.getConn()) == null) {
               good = false;
            }
            else {
               stmt = connMgr.loadPreparedStatement(statementName);
               stmt.setTimestamp(1, new java.sql.Timestamp(loggerBean.getStartTimestamp()));
               stmt.setTimestamp(2, new java.sql.Timestamp(loggerBean.getEndTimestamp()));
               stmt.setString(3, loggerBean.getCallerId());
               stmt.setInt(4, loggerBean.getRequestedId());
               stmt.setInt(5, loggerBean.getOwnerTypeId());
               stmt.setInt(6, loggerBean.getAppInfoBits());
               stmt.execute();

               Vector cancellations = loggerBean.getCancellations();
               if(cancellations.size() > 0) {

                  // First, get the Id back
                  statementName = "lookupLastInsertId";
                  stmt = connMgr.loadPreparedStatement(statementName);
                  rset = stmt.executeQuery();
                  // Then try to insert cancellation ids
                  if(rset.next()) {
                     int loggerId = rset.getInt(1);

                     statementName = "insertCancellation";
                     stmt = connMgr.loadPreparedStatement(statementName);

                     for(int i = 0; i < cancellations.size(); i++) {
                        CancellationBean cancellation = (CancellationBean)cancellations.get(i);

                        stmt.setInt(1, loggerId);
                        stmt.setInt(2, cancellation.getCancelledId());
                        stmt.setInt(3, cancellation.getOwnerTypeId());
                        stmt.execute();
                     }
                  }
               }
            }
         }
         catch (Exception e) {
            good = false;
            UtilBundle.log.logMessage(e, statementName, LogUtil.SEVERE);
         }
         // Free resources allocated.
         connMgr.shutDown(true);
      }
      catch (Exception e) {
         good=false;
         e.printStackTrace();
      }
      return good;
   }