Thanks for your help again Norm. I was blowing the whole thing out of proportion. All I changed was this:
boolean success = mapDrive(drive, terminal, MapDrive.usernames[i],
MapDrive.password);
to this
boolean success = mapDrive(drive, MapDrive.terminal, MapDrive.usernames[i],
MapDrive.password);
I was forgetting to add in MapDrive. Now it's working.