java处理列转行


Map> map = new HashMap>();
while(rs.next()){
if(map.get(rs.getString("TJBH"))==null){
Map map2 = new HashMap();
map2.put(rs.getString("CCDM"), rs.getString("SBNR"));
map.put(rs.getString("TJBH"), map2);
}else{
map.get(rs.getString("TJBH")).put(rs.getString("CCDM"), rs.getString("SBNR"));
}
}
rs.close();

你可能感兴趣的:(java-基础)