jQuery in Action, 2nd edition*
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 Murach's Java Servlets and JSP this week in the Servlets 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).]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Storing date as null value in the backend using JDBC
 
Similar Threads
Required text field
accessing non-static methods from JSP
Null issue
inserting null values in the backend using enterprise beans
two object transparent