我想在sqlite数据库中一次检索整行。所有这些都是字符串。我写了一个方法。 如果有人可以检查这个错误。 感谢如何在Sqlite中检索整行数据
public ArrayList<Integer> queueAll_row(){
String[] columns = new String[]{Key_row_ID,Key_Customer_name,Key_customer_nic,Key_roof,Key_floor,Key_walls,Key_toilets,Key_No_Rooms,Key_electricity,Key_drinkingWater,Key_status,Key_ownership
,Key_hvBankAcc,Key_loansOfOtherBnks,Key_current_No_Emp,Key_new_Emp,Key_income_source1,Key_income_source2,Key_income_source3};
Cursor cursor = ourDb.query(DB_Table, columns,
null, null, null, null, null);
ArrayList<Integer> values = new ArrayList<Integer>();
cursor.moveToFirst();
while (cursor.moveToNext()) {
values.add(cursor.getInt(0));
}
return values;
}
why getint(0)?也许它应该是cursor.getValue()或类似的东西 – 2014-10-22 05:45:49