aspose file tools*
The moose likes JDBC and the fly likes Storing date as null value in the backend using JDBC Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "Storing date as null value in the backend using JDBC" Watch "Storing date as null value in the backend using JDBC" New topic
Author

Storing date as null value in the backend using JDBC

savitha rao
Greenhorn

Joined: Jun 05, 2001
Posts: 6
Can any one let me know whether i can store a Timestamp object as null in the backend.
thanx in advance
Jamie Robertson
Ranch Hand

Joined: Jul 09, 2001
Posts: 1879

a date can be stored as a null in my table(oracle):
java.sql.Timestamp nullTimestamp = null;
...
ps.setDate(1,nullTimestamp); //will enter null into the database
hope this helps
Jamie
p.s. - Why don't you just try it?? If it works, then you can do it, if it does not work, then you can't. I don't know what constraints, relationships etc are on your table so it is hard for me to speculate its capabilities to store null values.

[This message has been edited by Jamie Robertson (edited August 13, 2001).]
 
Don't get me started about those stupid light bulbs.
 
subject: Storing date as null value in the backend using JDBC