Re: Zero dates "0000-00-00"
Re: Zero dates "0000-00-00"
- Subject: Re: Zero dates "0000-00-00"
- From: Gennady Kushnir <email@hidden>
- Date: Tue, 17 Mar 2009 21:08:22 +0300
> What is the exception and stack trace?
com.webobjects.jdbcadaptor.JDBCAdaptorException: Value '0000-00-00' can not be represented as java.sql.Date
it shows 2 stacks...
[2009-3-17 20:59:43 MSK] <WorkerThread9> Value '0000-00-00' can not be represented as java.sql.Dateat com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1055)
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:956)
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:926)
at com.mysql.jdbc.ResultSetRow.getDateFast(ResultSetRow.java:134)
at com.mysql.jdbc.ByteArrayRow.getDateFast(ByteArrayRow.java:235)
at com.mysql.jdbc.ResultSetImpl.getDate(ResultSetImpl.java:2115)
at com.mysql.jdbc.ResultSetImpl.getDate(ResultSetImpl.java:2067)
at com.mysql.jdbc.ResultSetImpl.getObject(ResultSetImpl.java:4895)
at com.webobjects.jdbcadaptor.JDBCColumn._fetchCorrectObject(JDBCColumn.java:294)
at com.webobjects.jdbcadaptor.JDBCColumn._fetchValue(JDBCColumn.java:384)
at com.webobjects.jdbcadaptor.JDBCColumn.fetchValue(JDBCColumn.java:372)
at com.webobjects.jdbcadaptor.JDBCChannel.fetchRow(JDBCChannel.java:1462)
at com.webobjects.eoaccess.EODatabaseChannel._fetchObject(EODatabaseChannel.java:321)
at com.webobjects.eoaccess.EODatabaseContext._objectsWithFetchSpecificationEditingContext(EODatabaseContext.java:3071)
at com.webobjects.eoaccess.EODatabaseContext.objectsWithFetchSpecification(EODatabaseContext.java:3195)
at com.webobjects.eoaccess.EODatabaseContext._fireFault(EODatabaseContext.java:4187)
at com.webobjects.eoaccess.EOAccessFaultHandler.completeInitializationOfObject(EOAccessFaultHandler.java:89)
at com.webobjects.eocontrol.EOCustomObject.willRead(EOCustomObject.java:1172)
at com.webobjects.eocontrol._EOMutableKnownKeyDictionary$Initializer$_GenericRecordBinding.valueInObject(_EOMutableKnownKeyDictionary.java:570)
at com.webobjects.eocontrol.EOCustomObject.storedValueForKey(EOCustomObject.java:1634)
at net.rujel.vseobuch._VOStudent.lastName(_VOStudent.java:71)
... etc (NSKeyValueCoding and appendToResponse)
and: at com.webobjects.jdbcadaptor.JDBCColumn._fetchValue(JDBCColumn.java:391)
at com.webobjects.jdbcadaptor.JDBCColumn.fetchValue(JDBCColumn.java:372)
at com.webobjects.jdbcadaptor.JDBCChannel.fetchRow(JDBCChannel.java:1462)
at com.webobjects.eoaccess.EODatabaseChannel._fetchObject(EODatabaseChannel.java:321)
at com.webobjects.eoaccess.EODatabaseContext._objectsWithFetchSpecificationEditingContext(EODatabaseContext.java:3071)
at com.webobjects.eoaccess.EODatabaseContext.objectsWithFetchSpecification(EODatabaseContext.java:3195)
at com.webobjects.eoaccess.EODatabaseContext._fireFault(EODatabaseContext.java:4187)
at com.webobjects.eoaccess.EOAccessFaultHandler.completeInitializationOfObject(EOAccessFaultHandler.java:89)
at com.webobjects.eocontrol.EOCustomObject.willRead(EOCustomObject.java:1172)
at com.webobjects.eocontrol._EOMutableKnownKeyDictionary$Initializer$_GenericRecordBinding.valueInObject(_EOMutableKnownKeyDictionary.java:570)
at com.webobjects.eocontrol.EOCustomObject.storedValueForKey(EOCustomObject.java:1634)
at net.rujel.vseobuch._VOStudent.lastName(_VOStudent.java:71)
2009/3/17 Chuck Hill <
email@hidden>:
>
> On Mar 17, 2009, at 10: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.
>> 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?
>
> What is the exception and stack trace?
>
>
> Chuck
>
>
>> Thanks in advance
>> Gennady
>
>
> -- Chuck Hill Senior Consultant / VP Development
>
> Practical WebObjects - for developers who want to increase their overall
> knowledge of WebObjects or who are trying to solve specific problems.
>
http://www.global-village.net/products/practical_webobjects
>
>
>
>
>
>
>
_______________________________________________
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