你加个判断啊 if list.isEmpty() 判断集合有没有数据 你不判断会出 nullpointexception
arraylist al;假如这个是你的数据库查询出来的记录 你先if(al.isEmpty()){
在这个里面写迭代 遍历 就行了 具体的 你要想知道要去看看 jdkApi的 isEmpty方法 isEmpty就是判断一个集合是否为空的
}
你这个代码应该 先判断 rs是否为null 到页面显示的时候判断 al是否为空 代码要健壮啊
select * from 表名 where name=“” and sex=“” and class=“”;