Students tempStudent = new Students();
changez-le en
Students tempStudent;
Vous overridding la property of same object depuis que vous avez créé le tempStudent outside la while loop . Vous devez ajouter les objects égal au number of record dans la base de données. Créez donc l'tempStudent object comme ci-dessous.
utiliser
while (rs.next()) {
tempStudent = new Students();
tempStudent.studentId = rs.getInt("StudentNo");
tempStudent.studentName = rs.getString("StudentName");
tempStudent.studentAge = rs.getInt("StudentAge");
students.add(tempStudent);
size++;
}