Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Storing date as null value in the backend using JDBC

 
savitha rao
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 1879
MySQL Database Suse
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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).]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic