while(rs.next())
{
com.home.bean.StatData sd = new com.home.bean.StatData();
sd.setName(rs.getString("name"));
sd.setCount(rs.getFloat("fee"));
list.add(sd);
}
我将查询结果集封装到ArrayList中 但是又不知道如何取出了特请教
{
com.home.bean.StatData sd = new com.home.bean.StatData();
sd.setName(rs.getString("name"));
sd.setCount(rs.getFloat("fee"));
list.add(sd);
}
我将查询结果集封装到ArrayList中 但是又不知道如何取出了特请教
{
com.home.bean.StatData temp=(com.home.bean.StatData)i.next();
System.out.println(temp.getName());
}另外list本身还有get(int index)方法.这个时候需要你指定list中元素的下标.比如:
int size=list.size();
for(int i=0;i<size;i++)
{
com.home.bean.StatData temp=(com.home.bean.StatData)list.get(i);
System.out.println(temp.getName());
}这些都在API文档中有描述啊,你为什么不仔细看看文档呢?