public static BasicUser lookUp(String username, char[] password){
    BasicUser ret = null;
    try {
      Connection conn = DriverManager.getConnection("jdbc:mysql://174.102.54.43/communityhub", "commhubuser", "foobar");
      String query = "SELECT password,role FROM user WHERE username='" + username + "';";
      Statement stmt = conn.createStatement();
      ResultSet rs = stmt.executeQuery(query);

      rs.next();
      String testPswd = new String(password);
      String dbPswd = rs.getString("password");
      String role = rs.getString("role");
      ArrayList<Group> legal = new ArrayList<>();
      
      query = "SELECT comm FROM commuser WHERE member='" + username + "';";
      stmt = conn.createStatement();
      rs = stmt.executeQuery(query);
      while(rs.next()){
        legal.add(new Group(rs.getString("comm")));
      }
      
      if(dbPswd.equals(testPswd)){
        switch(role){
        case "admin":
          ret = new HighPermUser(username, password, legal);
        break;
        case "moderator":
          ret = new MidPermUser(username, password, legal);
        break;
        case "user":
          ret = new LowPermUser(username, password, legal);
        break;
        }
      }
      
      conn.close();
    } catch(Exception ex) {
      System.out.print("ERROR:");
      System.out.println(ex.getMessage());
      System.out.println("Tried to login with:" + username);
      Logger.getLogger(Database.class.getName()).log(Level.SEVERE, null, ex);
    }
    return ret;
  }