日期:2014-05-18  浏览次数:20738 次

ResultSet问题
知道怎么把ResultSet返回值rs放到二维表Linkedlist中嘛   最好有代码

------解决方案--------------------
while(rs.next())
{
Object obj = rs.getObject(index);
LinkedList.add(obj);
}
------解决方案--------------------
楼上正解
------解决方案--------------------
hyxkangta123() ( ) 信誉:100 Blog 2007-02-15 15:47:52 得分: 0


我想把整个表放到Linkedlist中 add得时候不需要index get时候再根据需要获取 就像ResultSet那样!

-----------------------------------------------

像ResultSet哪样?
ResultSet取出有两种方式,一种是根据index,这种方式的话用一楼的方式就可以了。
还有一种是根据字段名,这样的话,linkedlist就不行了,得用linkedhashmap
------解决方案--------------------
楼上的正解,赞同!