List<Map<String, Object>>相关
2016年8月6日13:53:00
---------------------------
List
则需要:
List
List> list_new = new ArrayList >();
list_new .add(map);
------------------------------
List
粒子:
List> list_new = new ArrayList >(); Map map1=new HashMap (); map1.put("ks", "01"); map1.put("js", "10"); list_new.add(map1); Map map2=new HashMap (); map2.put("ks", "01"); map2.put("js", "10"); list_new.add(map2); for (Map map : list_new) { map.remove("js"); }
List
粒子:
List> list_new = new ArrayList >(); Map map1=new HashMap (); map1.put("ks", "01"); map1.put("js", "10"); list_new.add(map1); Map map2=new HashMap (); map2.put("ks", "01"); map2.put("js", "10"); list_new.add(map2); for (Map map : list_new) { map.put("js","11"); }
List
//公司wh框架的使用方法
String sql="select * from jxap " // + " left outer join (select jxjhid,ks from jxjh) jxjh on jxjh.jxjhid=jxap.jxjhid" + " where jxap.jlztm=51 and jxap.bjid=:bjid and jxap.jxjhid in(select jxjhid from jxjh where xqm=:xqm )"; SqlCommandImpl sci=new SqlCommandImpl(sql); sci.setInt("bjid", bjid); sci.setInt("xqm", xqm); List> list=gdba.selectAsMapList(sci,jxap);
//普通的框架
List> list = new ArrayList >(); // 关闭连接flag boolean colseFlag = false; // 打开DB链接 if (this.connection == null) { this.connection = this.getDbConnection(); colseFlag = true; } PreparedStatement preStat = null; preStat = this.connection.prepareStatement(sql); ResultSet rs = null; Map map = null; rs = preStat.executeQuery(); // 生成ResultSetMetaData ResultSetMetaData rsMeta = preStat.getMetaData(); while (rs.next()) { map = this.Result2Map(rs, rsMeta); // 追加到list中 list.add(map); }