- Java code
public List<FundShopDao> find(Object object,Object object1,Object object2){ List<FundShopDao> fundshops = new ArrayList<FundShopDao>(); SQLiteDatabase db = dbOpenhelper.getReadableDatabase(); Cursor cursor = db.rawQuery("select * from fundshop where code like '%"+object.toString()+"%' or type = ? or investObj = ? order by code asc", new String[]{null,object1.toString(),object2.toString()}); if(cursor.moveToFirst()){ int id = cursor.getInt(cursor.getColumnIndex("id")); String code = cursor.getString(cursor.getColumnIndex("code")); String shortname = cursor.getString(cursor.getColumnIndex("shortname")); String fundmangt = cursor.getString(cursor.getColumnIndex("fundmangt")); String type = cursor.getString(cursor.getColumnIndex("type")); String opendate = cursor.getString(cursor.getColumnIndex("opendate")); String scale = cursor.getString(cursor.getColumnIndex("scale")); String investObj = cursor.getString(cursor.getColumnIndex("investObj")); fundshops.add(new FundShopDao(id,code,shortname,fundmangt,type,opendate,scale,investObj)); } cursor.close(); return fundshops; }
------解决方案--------------------