This week's book giveaway is in the OCMJEA forum. We're giving away four copies of OCM Java EE 6 Enterprise Architect Exam Guide and have Paul Allen & Joseph Bambara on-line! See this thread for details.
Im a newcomer to SQL. I have a web page where I am accepting a username and a password and then authenticating the user by checking if his username and password exists on the dbase. I am using the method below. but it alway returns false meaning that the username and password doesnt exists but in the Dbase I can clearly see that the particular user with the supplied username and password does exist. How can I rework or make changes in this code. What am I doing wrong?Thanks for all your help
My assumption would be that it is throwning a SQLException instead, since that is pretty much the only way could possible return nothing. How do you call the method? Are you handling the possible exception or are you throwing it away?
Shouldn't that be: The result should look like this: Regards, Jan
(have a look at PreparedStatement. It makes your code cleaner.) (and have a look at container managed security. Your server will have user authentication functionality on board.) [ May 03, 2007: Message edited by: Jan Cumps ]