aspose file tools*
The moose likes JDBC 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


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Databases » JDBC
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.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: User registration page validation after clicking submit.
 
Similar Threads
regarding Update syntax of query
How to Validate duplicate entries in database using struts1
reset jsf form
javax. servlet. Servlet Exception: java. sql. SQLException
How to display error message