This week's book giveaway is in the General Computing forum.
We're giving away four copies of Arduino in Action and have Martin Evans, Joshua Noble, and Jordan Hochenbaum on-line!
See this thread for details.
The moose likes JDBC and the fly likes default date? Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


JavaRanch » Java Forums » Databases » JDBC
Reply Bookmark "default date?" Watch "default date?" New topic
Author

default date?

Jennifer Sohl
Ranch Hand

Joined: Feb 28, 2001
Posts: 455
Hi. I've noticed that when you declare a column of the datetime datatype in SQL it puts in a default value of 1900-01-01 00:00:00.000
Is there a simple way that I can check and see if the date is this value and if so, not display it in my text field?
Is there something like an 'isDefault(boolean)' method that I can use to determine that, or is it more complicated than that?
Thanks for any help!
Dave Vick
Ranch Hand

Joined: May 10, 2001
Posts: 3244
Jennifer
I don't know about a test for default but could you make the column so it accepts null and then specify null as the default, then you'd only have to test for null??...


Dave
Jennifer Sohl
Ranch Hand

Joined: Feb 28, 2001
Posts: 455
That's what I thought. Just thought I'd double check and make sure I wasn't missing something.
Thanks for the help!
 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: default date?
 
Similar Threads
dateformatter...
Date format issue
Date 01/01/1970 returning non-zero value for time
Specify Date as 0000-00-00
MySQL JDBC Driver and Null Dates