aspose file tools
The moose likes JDBC and the fly likes How to insert a null into a timezone column Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Databases » JDBC
Reply Bookmark "How to insert a null into a timezone column" Watch "How to insert a null into a timezone column" New topic
Author

How to insert a null into a timezone column

Anthony Smith
Ranch Hand

Joined: Sep 10, 2001
Posts: 285
I have a SQL statement written in Java. I don't have access to modify the statement, only to populate the values that it needs. If I don;t have a timestamp value to add, what can I set as a default so that I won't keep getting this error:

ORA-01841: (full) year must be between -4713 and +9999, and not be 0

I tried stuff like '' and "". no Luck
Paul Sturrock
Bartender

Joined: Apr 14, 2004
Posts: 10336

PreparedStatement + setTimestamp(null)


JavaRanch FAQ HowToAskQuestionsOnJavaRanch
Avi Abrami
Ranch Hand

Joined: Oct 11, 2000
Posts: 1112

Anthony,
If you are using a "PreparedStatement" (as Paul suggests), then I believe you need its "setNull()" method, for example:

Good Luck,
Avi.
 
I agree. Here's the link: http://zeroturnaround.com/jrebel/download
 
subject: How to insert a null into a timezone column
 
Similar Threads
Statement, ResultSet
Help with Try-Catch-Finally statement
will vector handles the objects in orderwise
Another Error this time while trying to run "cannot find class"?
Array in reverse order......?