I've set up a gui that has a login interface and a database which stores usersnames and passwords, but when im trying to login on the gui its giving me invalid login even when i put in the exact data from my database.
1 Answer
Change your Sql Statement as
select userName,password from person where userName = ? and password = ?
instead of
select userName from person where userName = ? and password = ?
UPDATE
Infact you no need to check again username and password in java code, your query itself will tells you he/she is valid or not
resultsetreturn some data or empty data ?resultsetreturn username/password, check the letters cases, becauseequals("string")is case sensitive function.