Also, and this is more of a
JDBC issue than a servlet one, it is very inefficient to pull all the records from the table and loop through them in the
Java code like that.
Instead of "SELECT * FROM LOGIN", use
"SELECT * FROM LOGIN WHERE user_name = '" + user + "' AND password = '"" + pass + "'";
(or better, use a preparedStatement).
This will return either 0 or 1 rows.
This lets the database, which is much more suited to this type of work, handle the searching. It also cuts down on the network traffic between the database and webserver machines.