tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Justin Rowles" <>
Subject RE: integer value
Date Mon, 25 Feb 2002 17:22:46 GMT
> I have a doubt, I have a form that has name and his phone 
> number, both the fields are optional. I declared name as 
> VARCHAR and number as INTEGER in my SQL database. When the 
> user leaves the fild empty, I get an error with the number 
> field as NumberFormatException. 

If you really want to do it this way, you can catch the exception (see a book on Java) and
set it there.

Better still, don't try to force the data into an integer field, cos it isn't really.  You
can check that it is only made of certain characters (0-9) instead.

You're only jealous cos the little penguins are talking to me. 

For more information on Ordnance Survey products and services,
visit our web site at

To unsubscribe:   <>
For additional commands: <>
Troubles with the list: <>

View raw message