Re: Zero dates "0000-00-00"
Re: Zero dates "0000-00-00"
- Subject: Re: Zero dates "0000-00-00"
- From: Q <email@hidden>
- Date: Thu, 23 Apr 2009 07:54:55 +1000
On 23/04/2009, at 2:58 AM, Katya Yurukova wrote:
Hi list,
I've stumbled on a problem related to this issue. The database is
MySQL again and the zero dates are widely used there. What causes my
problem is that when an EO is fetched and it had a zero date set for
some column, the corresponding property is set to null, so when I
edit and try to save the modified object I get an exception because
the column that contained the zero date does not allow null. Do you
know if there is some work around for this ?
If you set the field to NSTimestamp.DistantFuture instead of null it
will result in a zero date in the database, the only problem is that
this might confuse EOF.
Your least painful option is probably going to be to add a default
value to the not null field to replace the null with a zero date.
Thanks in advance,
Katya
On Mar 17, 2009, at 10:11 PM, Gennady Kushnir wrote:
If it's MySQL your jdbc connection url should probably have:
....?zeroDateTimeBehavior=convertToNull
WOW! that worked!
Thanks a lot!
2009/3/17 Lachlan Deck <email@hidden>:
On 18/03/2009, at 4:48 AM, Gennady Kushnir wrote:
Hello list.
Is there some known hint to get rid with exception raised when
dealing
with zero dates in SQL?
I'm taking data from database maintained with a third party
program.
What type of database?
When a date is undefined that program puts "0000-00-00" into
database
which is acceptable for SQL but raises an exception in WO.
How can I make EOF treat that value normally returning null for
date
in corresponding EnterpriseObject?
If it's MySQL your jdbc connection url should probably have:
....?zeroDateTimeBehavior=convertToNull
with regards,
--
Lachlan Deck
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden
--
Seeya...Q
Quinton Dolan - email@hidden
Gold Coast, QLD, Australia (GMT+10)
Ph: +61 419 729 806
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden