daily pastebin goal
15%
SHARE
TWEET

Untitled

a guest Sep 26th, 2016 65 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. public String getSingleEntry(String username) {
  2.         Cursor cursor = db.query("credentials", null, " USERNAME=?", new String[] {username}, null, null, null);
  3.         if (cursor.getCount() < 0)//1->0,nomizw to 0 simenei oti brike 1
  4.         {
  5.             cursor.close();
  6.             return "NOT EXIST";
  7.         }
  8.         if(cursor.getColumnCount() <0)//1->0,nomizw to 0 simenei oti brike 1
  9.         {
  10.             cursor.close();
  11.             return "NOT EXIST";//apla to vala gia to message
  12.             //Den pire ka8olou data an kai perase to Where Clause
  13.         }
  14.         if(cursor.moveToFirst())//ama kataferi na paei sthn arxh
  15.         {
  16.             String password = cursor.getString(cursor.getColumnIndex("PASSWORD"));//to la8os ginotan EDW,den ebriske to column me onoma "PASSWORD"
  17.             cursor.close();
  18.             return password;
  19.         }
  20.         else {
  21.             cursor.close();
  22.             return "NOT EXIST";
  23.         }//den borese na paei sthn arxh
  24.     }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top