Bookmark Topic Watch Topic
  • New Topic

how to handle Null values?

 
padma patil
Ranch Hand
Posts: 41
  • Mark post as helpful
  • send pies
  • Report post to moderator
Hi,
In HTML Form(Add data) in which I have text box,radio,checkbox, etc .And I am reading getting form data and putting it in mysql database using prepareStatement. and I have another form(view data) in which I am fetching data from database and displying it on view data form using Resultset.
I am having following problems
1) If any one of the form field are empty the getParameter() returns Null and it saves null into database but when I try to fetch data from database which is null , I am getting Null pointer exception.
How to handle this?
2)I have one Date field and another DateTime filed in mysql database. While storing data using preparedstatement is stores DateTime and DAte values but while retriving from date using Resultset which has only getDate() method it truncates the time part from datetime field.

I also like to know how to convert String to float and Long.
any help in these problem are greatly appreciated.
Thanks,
Padmashree
 
Dave Vick
Ranch Hand
Posts: 3244
  • Mark post as helpful
  • send pies
  • Report post to moderator
Padma
I answered your other post in JDBC.
Also, please don't cross post your questions to multiple forums, most of the visitors here read in many of the forums and it is frustrating to see the same question repeated over and over - you have a better chance of gettng a correct and timely answer if you post it to the most appropriate forum instead of using the shotgun aproach and hoping you'll hit something.
 
    Bookmark Topic Watch Topic
  • New Topic
Boost this thread!