Enviroment: Android
Database: SQLite based
I have a database created with sqlite, the database contains users details such as login, password, name, surname, country. My problem is to create query which will check the login and password [ so select query ] and than allow or not to proceed.
public void logineSelector(String log, String pass){
String[] kolumny = new String[]{colLogin, colPassword};
Cursor cursor= sqLiteDatabase.query(Usr_TABLE, kolumny, pass, null, null, null, null);
}
but the this makes the whole program total mess, debug console gives me this:
Fatal Exception: Main
Java.lang.IllegalStateException: Could not execute method of the activity
.....
any suggestions what to do?
You’re not calling the query method with the correct parameters. Check the javadoc.
If you’re trying to find the user with the login/password that you pass into the method, you probably want to do something like:
assuming that you have defined USER_COL and PASS_COL to contain the names of the columns in question.