Title: Message
Praveen-
 
It looks like your query is retrieving the whole set of users and then iterating in Java to see if any of them match the username/password the user entered.  Why would you do that, rather than simply:
 
SELECT * FROM users WHERE username = '<username entered by user>' AND password = '<password entered by user>';
 
and see if any rows are returned.  If there are no rows, the username and/or password was wrong.  This way you don't have to deal with so much data, making it potentially much faster and less memory intensive.
 
-jmc

Reply via email to