dcsimg
Setting datetime fields to NULL if no value to be inserted
0 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   neal_ravindran
Posted On:   Friday, February 27, 2004 10:06 AM

I use MS SQLServer 2000 and use the MS provided free JDBC driver.



I do the follwing in code, to insert NULL when there is no datetime value for a datetime field:-

stmt.setNull(6,java.sql.Types.DATE);


I see 1/1/1900 as a result in the field.
How do I prevent that (meaning, 1/1/1900) from being inserted? I want the field to have NULL value.

About | Sitemap | Contact