*
The moose likes Servlets and the fly likes Verify/deny a new user to MySQL via Servlet Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "Verify/deny a new user to MySQL via Servlet" Watch "Verify/deny a new user to MySQL via Servlet" New topic
Author

Verify/deny a new user to MySQL via Servlet

Marvin Harrison
Greenhorn

Joined: Mar 03, 2005
Posts: 20
The user is correctly denied if user enters the first "dbemails" value.

However, if it is a new user, the users are "squarely compounded/added" into MySQL.

Eg: user2, user3,user3, (user4, user4, user4, user4), (user5x8), (user6x16)
etc.
I have no clue what is going on here, thank you.

The pastebins are better formatted, but posted code here anyway.
Thank you
http://pastebin.ca/23893
http://pastebin.ca/23892

Here is the jsp, also viewable at:
http://pastebin.ca/23893
*********************************************

**********************************end JSP


and the SERVLET, also viewable at:
http://pastebin.ca/23892
*******************************

**********************

[Edit by Dave - code tags added]
[ September 25, 2005: Message edited by: David O'Meara ]
David O'Meara
Rancher

Joined: Mar 06, 2001
Posts: 13459

1, 2, 4, 8, 16

It looks like each time you read the values from the database, you are reading everything and re-inserting. Hence you double the number of times each user exists.

Have a look at the way you use your while(rs.next()), consider adding a 'where' clause to the query and using an 'if(rs.next())' instead.

I have to admit I just browsed the code and didn't read it all, it's a bit too much to digest.

Dave
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Verify/deny a new user to MySQL via Servlet
 
Similar Threads
Servlet becomming slow
Servlet becomming slow
servlets using JDBC
JDBC/Servlets question
JSP-Tomcat-MySQL connection problems