The easiest method is to create string that has all the information in it:


// replace the bold stuff with this
String toDisplay = "";
while (res.next())
{
...