java处理列转行

 Map<String, Map<String,String>> map = new HashMap<String,  Map<String,String>>();
 while(rs.next()){
     if(map.get(rs.getString("TJBH"))==null){
          Map<String,String> map2 = new HashMap<String,String>();    
          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,map)