0
我加入类对象为我的数组列表,现在我要重复在一个循环中的对象并保存到数据库迭代类对象的ArrayList中的Java
我bean类
public class SchemeBean {
private String code;
private String name;
private String value;
public String getCode(){
return code;
}
public String getName(){
return name;
}
public String getValue(){
return value;
}
public SchemeBean(String code,String name,String value){
this.code=code;
this.name=name;
this.value=value;
}
}
在阵列中添加的类对象
ArrayList items= null ;
String hd1 = jsonLineItem.getString("hd1");
String hd2 = jsonLineItem.getString("hd2");
String code = jsonLineItem.getString("code");
items.add(new SchemeBean(code,hd1,hd2));
现在我有具有克此ArrayList项SchemeBean的对象添加到它的元素
现在我的要求是,我必须迭代它并将其添加到数据库IAM不理解如何迭代它。请任何暗示会为我