I am using SQLLite Database supplied by Android.
I have a Table myTable with two coloumns: col_id and colName. The gettersetter class is as follows:
public class MyTable{
private long id;
private String colName;
public long getId() {
return id;
}
public void setId(long id) {
this.id = id;
}
public String getColName() {
return colName;
}
public void setColName(String colName) {
this.colName = colName;
}
}
I have a method in database connector which inserts a single row :
public void insertMyTable(String colName)
{
ContentValues newCon = new ContentValues();
newCon.put("colName", colName);
open();
database.insert("myTable", null, newCon);
close();
}
Is there a way to insert a List of objects of type MyTable into the database, i have over 100 records to be inserted at once.
Thanks in advance