I use sql query to insert data into database, everything work fine if i insert just one record into table,here is my code
1. setData("insert into table(name,age) values ('john','23')");
code for insert data above succesful saved in database, but I if i use this code bellow
2. setData("insert into table(name,age) values ('john','23'),('jane','20'),('mraz','21'),('albert','12'),('josh','23')");
and methode for insert like this
public String setData(String sql){
ourDatabase.execSQL(sql);
return "success";
}
if i use code no 1, data successfull inserted but if i use code no 2 it fail. here log for code no 2
Failure 1 (near ",": syntax error) on 0x24b900 when preparing 'insert into table(name,age) values ('john','23'),('jane','20'),('mraz','21'),('albert','12'),('josh','23')'.
what wrong with code no 2 ? if i try use code no 2 in mysqlfront or phpmyadmin without throught android is work fine,and second problem is,if i run in jellybean data succesfull inserted into database,but if i run in gingerbread code no 2 trouble?