日期:2014-05-20  浏览次数:20845 次

JAVA List<Map<String,String>> 排序
在JAVA中 List<Map<String,String>> 这样的list有没有办法按字母排序


------解决方案--------------------
ORDER BY不行吗?

ps = conn.prepareStatement("SELECT * FROM TABLE WHERE USER_ID = ? ORDER BY ZIMU");
ps.setLong(1, me.getId());
rs = ps.executeQuery();
while (rs.next()) {
map = new HashMap();
map.put("ID", rs.getLong(1));
map.put("ZIMU", rs.getString(2));
list.add(map);
}
return list;