Handling String date format "0000-00-00 00:00:00" removed in latest version???
Posted by: Simon Haldon
Date: February 18, 2005 06:59AM

I recently tried upgrading to connector/J 3.1.6 - only to find this immediately broke my application wherever I was using zero dates in string format "0000-00-00 00:00:00".

The connector/J changelog states that there are now three ways of handling zero dates, the default now being 'exception', and that other methods of handling can be specified in the server.xml connection url. This enabled me to correct the initial errors with zero dates.

HOWEVER even if I change my server.xml, change all my zero dates to the supposedly valid "0001-01-01 01:01:01" (or "0001-01-01 00:00:00" I tried both) and change all (PreparedStatement) queries to reflect this, the MySql server dies a death as soon as I try to execute a query that references the date field
(select ... where date='0001-01-01 01:01:01').

The error (repeated - for each row in resultset?):
Communications link failure due to underlying exception:


MESSAGE: Connection reset


java.net.SocketException: Connection reset

The errors occur identically on two installations - one running under Tomcat 5.0 and one Tomcat 5.5.7.

I have reverted to connector/J 3.0.11 for now which works fine, but if anyone knows a way round this, it would help. I'm very surprised indeed that 3.1.6 is not backwards-compatible? - guess I'll be sticking with 3.0.11 unless something changes.

Options: ReplyQuote

Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.