Così ti stampa solo l'ultimo che trova fatti ritornare una stringa html con tutti i risultati
codice:
while(rs.next()) {
                 out = out  + rs.getString(1) + " " + rs.getString(2); + "
";           
}