everyone. This is a piece of code from using sqlite in android tutorial:
return db.update(employeeTable, cv, colID+"=?",
new String []{String.valueOf(emp.getID())});
I don’t understand why in colID+"=?" after ‘=’ stay ‘?’
Anyone can explain this, please?
Thanks for everyone!
This is a Prepared Satatement. In this case, you can define a query as a template and left some parameters to fill dynamically. You represent the parameter with an
?.In your case, you are indicating that
String.valueOf(emp.getID())will substitute the?.