Check out these:
Adding your own Validation Handler tutorial:
http://developers.sun.com/prodtech/javatools/jscreator/learning/tutorials/2/cus tomvalidator.html
And then you could have a cachedrowset with your query to send in the value as parameter and check, if it exists in the database.
If you want to do the JDBC way ...
http://blogs.sun.com/roller/page/jfbrown/20051116
HTH,
Sakthi
The Login page in the adventure builder sample application does something like what you want. Here is an excerpt from the source
getSessionBean1().getSignonRowSet().setObject(1,(String)getNewUsernameTextField().getText());
signonDataProvider.refresh();
if (signonDataProvider.getRowCount() > 0) {
error("This name is already used. Try a different name.");
return null;
}
Also, here is an AJAX way to do it (JavaOne LAB-5655Building AJAX-Based JavaServer Faces Web Applications With Sun Java Studio Creator):
http://www.javapassion.com/handsonlabs/5655_ajaxcreator.zip
> code]getSessionBean1().getSignonRowSet().setObject(1,(
> String)getNewUsernameTextField().getText());
>signonDataProvider.refresh();
>
> if (signonDataProvider.getRowCount()
> > 0) {
> error("This name is already used.
> Try a different name.");
>return null;
> code]
Great, that's what I was looking for.
>
> Also, here is an AJAX way to do it (JavaOne LAB-5655
> Building AJAX-Based JavaServer Faces Web
> Applications With Sun Java Studio Creator):
>
> http://www.javapassion.com/handsonlabs/5655_ajaxcreato
> r.zip
I'll take a look at it also.
Thanks
--
Haim