I'm trying to make a simple login activity using email and password from my Mysql Database.
Now, i set the email value to "e" and the password to "e1" (to test it). And i import it to my app into a string, i check if the password and the email are true:
res = st.executeQuery("SELECT * FROM Users WHERE Email = '"+emailVar+"' AND Password = '"+pswdVar+"' ");
while (res.next()) {
String pswdDb = res.getString("Password");
String emailDb = res.getString("Email");
if (emailVar == emailDb && pswdVar == pswdDb)
{
Intent I = new Intent (this, MainActivity.class);
startActivity(I);
}
but the if statement always returns false.
After debugging i saw that the value from the database and the input value are equal.
How do i fix this??