【发布时间】:2020-04-08 19:32:37
【问题描述】:
当我通过 JSON 从我的服务器传递数据时。我遇到了这个错误。
android.database.sqlite.SQLiteException: near "rusitha": syntax error (code 1): , while compiling: INSERT INTO customer (id, name,nic,areaId,tp,address) VALUES ('583', 's.p.m.j.ilangasinghe.', '805250666v','18','0716090398','no.79,'rusitha',nuwarapara,maradankadawala.');
这是我使用的代码。
for(i = 0;i<customerId.length();i++){
sqlite.execSQL("INSERT INTO customer (id, name,nic,areaId,tp,address) VALUES ('"+customerId.get(i).toString()+"', '"+customerName.get(i).toString()+"', '"+customerNIC.get(i).toString()+"','"+customerAreaId.get(i).toString()+"','"+customerTp.get(i).toString()+"','"+customerAddress.get(i).toString()+"');");
}
【问题讨论】:
标签: android json sqlite android-sqlite