我想执行一个查询并将这些值添加到循环内的文本字段中。我想要这样的东西
String query = "select student_id,String firstName,lastName,address,phoneNumber,mobileNumber,fathersName,fathersOccupation,mothersName,nationality,qualification from student where student_id='" + jTextField5.getText().toString() + "'";
ResultSet rs = DBOptions.executeSQLQuery(query);
rs.next();
for(int i=0; i < 11; i++){
String s = rs.getString(i+1);
String field = "jTextField"+i+".setText(s)";//can you do something like this and use the string to add values to individual textFeilds?
}
我曾尝试查看 ArrayList 和其他方式,但它们似乎令人困惑......