假设有张表有两个字段a,b(假设这两个字段都是字符类型的)
你从数据库中去出来的时候
List list =new ArrayList();
while(rs.next()){
Map map=new HashMap();
map.put("a",rs.getString("a"));
map.put("b",rs.getString("b"));
list.add(map);
}
这样你要的数据都在list中的map中
List和Map共同实现多数据内容的存放和传递
最新推荐文章于 2024-09-23 22:53:50 发布