public List<XintaiEntity> findMessListX(Integer year,Integer month)
{
List<XintaiEntity> jiluji = new ArrayList<XintaiEntity>();
// 只对读的操作的方法
SQLiteDatabase db = getReadableDatabase();
Cursor cursor = db.rawQuery("select * from zixingbiao where year=?and month=? ",new String[]{"%year%","%month%"});
cursor = db.query("xintaibiao", null, null, null, null, null, null, null);
while (cursor.moveToNext())
{
int xintai=cursor.getInt(cursor.getColumnIndex("xintai"));
int day=cursor.getInt(cursor.getColumnIndex("day"));
jiluji.add(new XintaiEntity(year, month, day,xintai));
}
cursor.close();
db.close();
return jiluji;
{
List<XintaiEntity> jiluji = new ArrayList<XintaiEntity>();
// 只对读的操作的方法
SQLiteDatabase db = getReadableDatabase();
Cursor cursor = db.rawQuery("select * from zixingbiao where year=?and month=? ",new String[]{"%year%","%month%"});
cursor = db.query("xintaibiao", null, null, null, null, null, null, null);
while (cursor.moveToNext())
{
int xintai=cursor.getInt(cursor.getColumnIndex("xintai"));
int day=cursor.getInt(cursor.getColumnIndex("day"));
jiluji.add(new XintaiEntity(year, month, day,xintai));
}
cursor.close();
db.close();
return jiluji;
}
获得某个月的所有的值得一个数据库操作