hi,
The string "null" is not the same as null. Technically, the user could also
enter the string "null" in a texfield. Then it becomes messy to check for all
the exceptions etc. Best option is to store NULL in the database.

regards,
Nagarajan.


On Friday 05 April 2002 12:40, you wrote:
> Posting this question again as not sure that it has been sent properly.
> Hello everybody,
> I have another question.
> The fields in the database are optional. Now when the bean to inserts the
> data in the table, it puts in a string which reads as "null"  but  for the
> database it is an value equal to the string "null" & not the database NULL
> for the field. Hence, when I write my queries, I search for a string equal
> to 'null' instead of the field which "Is Null"
> Now, my question is that
> *       is there a way out of this?
> *       what is better programming practice, you allow the null string
> which the java bean puts on its own or you put the database NULL value for
> null fields by modifying the insert query?
>
>         Kindly help .
>         Thank you in advance.
>         Regards,
>         aruniima
>

===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST DIGEST".
Some relevant FAQs on JSP/Servlets can be found at:

 http://archives.java.sun.com/jsp-interest.html
 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.jsp
 http://www.jguru.com/faq/index.jsp
 http://www.jspinsider.com

Reply via email to