Page 835 - 완) I MDP 프로젝트 작품 보고서(전체과 1학년)1.6
P. 835

공중망을  이용한  애완동물  사료  공급기



                        while(c.moveToNext()){

                             vector.add(new
             ParkStation(c.getInt(0),c.getString(1),c.getInt(2),c.getString(3),Timestamp.valueOf(c.getString(4
             )),c.getInt(5)));

                        }
                        return   vector;
                  }


                  public  boolean  isNull()  {

                        SQLiteDatabase db  =  getReadableDatabase();
                        Cursor cursor  =  db.rawQuery("SELECT * FROM  park_state where num  = 1;",  null);



                        if  (  cursor.getCount() !=  0) {
                             cursor.close();
                             db.close();
                             return  false;
                        }

                        else {
                             cursor.close();
                             db.close();

                             return  true;
                        }
                  }


                  public  void updateStateDb(String  location,int  state,String  _id){

                        SQLiteDatabase mDb =  getWritableDatabase();
                        ContentValues  values  = new ContentValues();
                        values.put("state", state);            //  바꿀값

                        values.put("id",  _id);  // 바꿀값


                        int  result =  mDb.update(DATABASE_TABLE,
                                  values,     //  뭐라고  변경할지  ContentValues 설정
                                  "locate=?",  //  바꿀 항목을  찾을  조건절

                                  new String[]{location});//  바꿀 항목으로  찾을  값  String  배열
                  }



             }



            인천전자마이스터고등학교
                                                         -  828  -
   830   831   832   833   834   835   836   837   838   839   840