next()方法真让我烦
public class Userdao extends BaseDao{
//查询名字
public ArrayList<Student> allName(){
ArrayList<Student> allname = new ArrayList<Student>();
String sql = "select sname from student";
try {
super.getConnection();
stmt = conn.createStatement();
rs = stmt.executeQuery(sql);
while(rs.next()){????????????????????这是什么意思
Student st = new Student();
st.setSid(rs.getInt("sid"));????????????
st.setSname(rs.getString("sname"));???????????
st.setSsex(rs.getString("ssex"));??????????
allname.add(st);
}
try {
super.closeAll();
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
} catch (SQLException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
return allname;
}