Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public Book findOne(String find) {
- SQLiteDatabase db = this.getReadableDatabase();
- Cursor cursor = db.query(TABLE_NAME, new String[]{KEY_NUMBER,
- KEY_JUDUL, KEY_NOTASI, KEY_TEMA}, KEY_NUMBER + "=?",
- new String[]{find}, null, null, null, "1");
- if (cursor.moveToFirst()) {
- do {
- Book buku = new Book(cursor.getString(0), cursor.getString(1), cursor.getString(2), cursor.getString(3));
- return buku;
- }while (cursor.moveToNext());
- }
- cursor.close();
- db.close();
- return null;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement