• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Verify/deny a new user to MySQL via Servlet

 
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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 ]
 
Rancher
Posts: 13459
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic