I have a LoginID database than can contain 1000's of users. Now to check if a user exist or not what am doing is am storing all the LoginID value of my database into an arraylist than checking if it exists or not using
Code:
while(result.next())
{
String str = result.getString(1);
LoginID_arraylist.add(str);
}
if(LoginID_arrayList.contains(loginid)
{
// if exist --> than another query using loginid
}
Is this a good way to achieve my desired result and what are my alternatives.....will it effect my performance if my size grows further..?? I am using MySql and JDBC.