aspose file tools*
The moose likes Servlets and the fly likes comparing timestamp object to null Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "comparing timestamp object to null" Watch "comparing timestamp object to null" New topic
Author

comparing timestamp object to null

harpd dhillon
Greenhorn

Joined: Jun 03, 2003
Posts: 8
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

Joined: Dec 19, 2002
Posts: 374
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 ]

"Write beautiful code; then profile that beautiful code and make little bits of it uglier but faster." --The JavaPerformanceTuning.com team, Newsletter 039.
harpd dhillon
Greenhorn

Joined: Jun 03, 2003
Posts: 8
thanks a lot for your David.
It workedddddddddddddddd!!!
harpd dhillon
Greenhorn

Joined: Jun 03, 2003
Posts: 8
i meant thanks a lot for you help.
have a good one
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: comparing timestamp object to null