This week's book giveaway is in the OO, Patterns, UML and Refactoring forum.
We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line!
See this thread for details.
The moose likes JDBC and Relational Databases and the fly likes User registration page validation after clicking submit. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Databases » JDBC and Relational Databases
Bookmark "User registration page validation after clicking submit." Watch "User registration page validation after clicking submit." New topic
Author

User registration page validation after clicking submit.

gyan kumar
Ranch Hand

Joined: Sep 28, 2011
Posts: 61
In a registration form there is a field "emailID" which should be unique so that dublicate rows will not be saved in database.

Now my query is how can at the time of submit the form I can execute the query in jsp so that it will take current emailID value.

please provide hint.

Patryk Sosinski
Greenhorn

Joined: Sep 10, 2011
Posts: 18
Easiest way, make the column in the database unique and then just handle error, or during form validation you can execute for example:

If the value is more than 0 then record with provided emailID is already in database.
There are more efficient queries than above but i dont know what kind of database are you using. Still i am not sure if it is what you asked, as your question is really difficult to understand.
gyan kumar
Ranch Hand

Joined: Sep 28, 2011
Posts: 61
Yeah, your understanding is correct.
 
Have you checked out Aspose?
 
subject: User registration page validation after clicking submit.
 
It's not a secret anymore!