서버에서 텍스트 및 부울 값을 가져 오는 중 데이터베이스에 저장해야합니다.부울 값을 갖는 sqlite?
이것은 내 테이블입니다. 부울 값을 sqlite에 INTEGER로 정의했습니다. 부울 값은 없습니다.
db.execSQL("CREATE TABLE outcomesStore(id INTEGER PRIMARY KEY AUTOINCREMENT , allowgo INTEGER,cod TEXT,youdidComments INTEGER, youwent INTEGER,ByDate INTEGER ," +
"OnCompletion INTEGER,yourtext TEXT , yourGroup TEXT, yourConsultation INTEGER)");
이 값은 서버에서 가져옵니다.
Store[] Storedata = Configuration.getStore();
booleanvalues[0] = Store[0].isallowgo();
이
helperdatabase = new DatabaseHelperInurseBusiness(this);
db = helperdatabase.getWritableDatabase();
ContentValues insertOutcomes = new ContentValues();
insertOutcomes.put(helperdatabase.ALLOW_GO,booleanvalues[0]);
db.insert("outcomesStore", helperdatabase.ALLOW_GO,insertOutcomes);
그것조차 어떤 오류를 포기하지 않을 작동하지 않는 것처럼 삽입.
삽입하기 전에'booleanvalues [0]'을 숫자로 변환하십시오. 시도해보십시오. insertOutcomes.put (helperdatabase.ALLOW_GO, 1); –