| 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
|
 |
 |
|
|
subject: comparing timestamp object to null
|
|
|