All pastes #263025 Raw Edit

Mine

public text v1 · immutable
·published 2006-12-01 03:26 UTC
rendered paste body
private static String[] clients = new String[]{"192", "localhost"/*, "rdsb"*/};
  private static ArrayList capsule = new ArrayList(clients.length);
  
  //protected static Log log = LogFactory.getLog(SetupServlet.class);
  private static List departments = null;
  private static List locations = null;
  private static List accounts = null;
  private static List tagCategories = null;
  private static List supplierNames = null;
  private static List userNames = null;
  private static List workorderNotificationsEmail = null;
  //private static BaseDAO dao = new BaseDAO(clients);
  
  
  
  static {
    
    for(int i=0; i<clients.length; i++) {                                       //load the capsule with the client data
      String c = clients[i];
      
      BaseDAO dao = new BaseDAO(c);
      ClientCapsule cap = new ClientCapsule();
      System.out.println("cap object created id: " + cap);
      cap.setClientName(c);                                                     //set the client name in the cap object
      cap.setClientId(i);                                                       //set the client id based on the array position
      
      try {
        /*tagCategories =*/ cap.setTagCategories(dao.getList("LabelValueSQL.selectAllTagCategories", null));
        /*departments =*/ cap.setDepartments(dao.getList("LabelValueSQL.selectAllDepartments", null));
        /*locations = */ cap.setLocations(dao.getList("LabelValueSQL.selectAllLocations", null));
        /*accounts = */ cap.setAccounts(dao.getList("LabelValueSQL.selectAllAccounts", null));
        /*supplierNames = */ cap.setSupplierNames(dao.getList("LabelValueSQL.selectAllSuppliers", null));
        /*userNames = */ cap.setUserNames(dao.getList("LabelValueSQL.selectAllUsers", null));
        /*workorderNotificationsEmail =*/ cap.setWorkorderNotificationsEmail(dao.getList("SysAdminSQL.getPmWoNotificationsList", null));
        
        capsule.add(cap);
        System.out.println("added cap to capsule: " + cap);
        
      } catch (Exception e) {
        System.out.println("Problem trying to create Lists in SetupServlet: " + e);
      }
    }
  }