Hi
I'm doing a project which requires a registration/login page. I have created both registration and login html pages and have done the validation servlet for the login page. I've also attempted the validation servlet for the registration page, but this is where I am struggling because I can't get the servlet to compare the username entered in the html form to usernames in the database to prevent duplicate usernames. This is the sql statement I have used...
...
try{
String uniqueSQL = "select * from members where username = ' "+username+" ' ";
Statement stmt = conn.createStatement();
ResultSet regvalidate = stmt.executeQuery(uniqueSQL);
...
if (ResultSet == username){
}
...
Does anyone have any ideas?
Thank you