Can you check (with a "select") if the username exists before you
insert the new record? That's what I do. If the name exists, I
tack on a "1", then try again until a unique name is found.
-----Original Message-----
From: A mailing list for discussion about Sun Microsystem's Java Servlet
API Technology. [mailto:[EMAIL PROTECTED]]On Behalf Of Sam
Rose
Sent: Tuesday, May 18, 1999 7:41 AM
To: [EMAIL PROTECTED]
Subject: error coding
Hello, thanks for the help on my last question about JavaScript.
I am trying to code my servlet so that if a certain SQL exception is
raised it will out put what is the problem is. The exception is for
when someone creates a user with the same username here's my code.
catch(SQLException ex) {
if (SQLException.equals("ORA-01920")) {
out.println("This username has already been chosen, please
use
another username");
}
else{
other things
}
}//end catch
I realise I am making a static reference to a boolean object, but I
don't know how to over come it.
___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".
Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html
___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".
Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html