Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

comparing timestamp object to null

 
harpd dhillon
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,
i'm developing a servlet that shows the fields of table in mysql , and if the field is null, it shows blank. I don't know how to compare timestamp object to null. For example:
java.sql.Timestamp endtime = rs.getTimestamp("endtime");
Now, i wanna check if the database value is null and if it is i wanna leave it blank.
thanks for your help
 
David Hibbs
Ranch Hand
Posts: 374
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
it the DB entry is null, rs.getXXX will return null. So a simple reference check will suffice. i.e.

[ June 03, 2003: Message edited by: David Hibbs ]
 
harpd dhillon
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks a lot for your David.
It workedddddddddddddddd!!!
 
harpd dhillon
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i meant thanks a lot for you help.
have a good one
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic