|
You shouldn't need
to do any comparisons at all in your code. Use:
String sqlStr =
"SELECT * FROM SAMM.UsersLogin WHERE LOWER(UserLoginId) = LOWER('"+username+"')
AND UserPassword = '"+password+"'";
stmt =
myConn.createStatement();
myResultSet =
stmt.executeQuery(sqlStr);
if(
myResultSet.next() ) {
// we have a valid user!
}
else
{
// we don't have a valid user!
}
And make sure you
catch and log any SQLExceptions that may occur, as they'll help you out no end
in debugging...
|
Title: Message
- Login Authentication against database... Praveen Potineni
- Re: Login Authentication against database... Chris Tucker
- Re: Login Authentication against database... Joe Cheng
- Re: Login Authentication against database... Praveen Potineni
- Re: Login Authentication against databas... Chris Tucker
- Re: Login Authentication against dat... Praveen Potineni
- Re: Login Authentication against databas... David Nguyen
- Re: Login Authentication against database... Margaret Fisk
- Re: Login Authentication against database... Miao, Franco CAWS:EX
- Re: Login Authentication against database... Joe Cheng
- Re: Login Authentication against database... Syed Rehman
- Re: Login Authentication against database... Miao, Franco CAWS:EX
- Re: Login Authentication against database... Chris Tucker
- Re: Login Authentication against database... Syed Rehman
- Stupid newbie question Papo Napolitano
