which list, ArrayList? Impossible!

解决方案 »

  1.   

    hehe,我也很奇怪,arrayList
      

  2.   

    Iterator it = licenceList.iterator();
    while (it.hasNext()) {
    String temp = it.next().toString();///1
    }
    执行语句1的时候游标就从1跳到3,不知道额外为什么?
      

  3.   

    如果你的是Hashmap Hashtable, Hashset之类,这样的情况是正常的它在类的说明中已经明确说明不能保证你所需要的顺序,你使用ArrayList之类的吧
      

  4.   

    实际上我debug的时候while循环中执行一个语句游标就跳1,不管这个语句和it是不是有关
      

  5.   

    while (it.hasNext()) {
    String temp = it.next().toString();
    map.put("licenceText", temp);
    insertSQL = this.getInsertSQL("tb_licencerecord", map);
    stat = conn.createStatement();
    stat.executeUpdate(insertSQL);
    //stat.addBatch(insertSQL);
    }
      

  6.   

    你要得到第一个ITER
    应该用
    Iterator it = licenceList.begin();
      

  7.   

    那也就是说当他从第一个游标跳到最后一个游标,然后while循环就结束了?这不合理吧?
      

  8.   

    用licenceList.begin()么?但我以前都是那样用的呀?而且很多书上都是.iterator的呀?不管怎么样,我试一下....:)