I hav a html form in which i will be entering a value. I am reading this value using request.getParameter(..) in a jsp and trying to insert that into database. The corresponding column in database is of number type. When i dont enter any value in the form and submit it request.getParameter(..) is returning me a blank string. What if i wanted to insert a null into the database....?
I dont want to make to query static by checking the return value.
What i want to know is ...Is there any why by which it should automatically insert the value if present else insert null.( but no zero )
This is a very difficult problem that may take years to figure out. Good luck.
convert the null value into empty string
use this method
public String nullReplace(String inputfield)
if(inputfield == null)
and try inserting it.