ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From vc_ace <vc_...@yahoo.com>
Subject Re: Ibatis crashing MySQL when I use DATE_FORMAT
Date Mon, 11 Sep 2006 15:45:48 GMT

I just wanted to thank everyone for their input and let you know there was a
bug reported with the mysql team.  I sent that info to my host so hopefully
they get the patch in.  But I agree that it is much safer to handle the
formatting in the Java code.  On the to do list...


vc_ace wrote:
> 
> I should have tried that straight away.  Ibatis is not the problem.  My
> bad.
> 
> 
> 
> Brandon Goodin wrote:
>> 
>> I would encourage you to first try it with pure jdbc and run the exact
>> sql
>> statement that is executed. IBatis does nothing magical in regards to the
>> database. It simply calls standard JDBC.
>> 
>> Brandon
>> 
>> On 9/9/06, vc_ace <vc_ace@yahoo.com> wrote:
>>>
>>>
>>> This is very strange but it appears as though Ibatis is crashing my
>>> MySql
>>> instance when I use the DATE_FORMAT function in SQL.  Please note: it
>>> only
>>> crashes when I use a format string that resolves to text like %a
>>> (Abbreviated weekday name) , %b (Abbreviated month name).  The problem
>>> doesn't seem to exist for format strings that return numeric data.
>>>
>>> MY SQL:
>>> <statement id="getEmailList"  resultClass="com.vc.domain.Email">
>>>                 SELECT emailTrn.id, DATE_FORMAT(email.entryDate, '%a. %b
>>> %D - %h %i %p'
>>> ) as entryDateS, FROM email, emailTrn WHERE emailTrn.userId = 1 AND
>>> emailTrn.emailId = email.id
>>>          </statement>
>>>
>>> MY SET-UP:
>>> MySql: 4.1.21
>>> Java: 1.5.0_08
>>> Ibatis: 2.1.7
>>> Connector/J: 3.1.13
>>> Running using Struts
>>>
>>> Please note: I had the same problem when I was using Ibatis 1.x.  I
>>> upgraded
>>> to see if that resolved the problem.
>>>
>>> OTHER INFORMATION
>>> 1.      My application can hit the database
>>> 2.      I can hit all of my other SQL statements without problem or
>>> errors
>>> messages
>>> 3.      I'm not sure when this problem started but it does not happen
>>> when
>>> I run
>>> MySql 4.1.18. Unfortunately not an option with my hosting provider.  So
>>> I'm
>>> thinking there is a problem with Ibatis and this version of MySql.
>>>
>>> Any help or insight would be appreciated.  I'd provide my other Ibatis
>>> configuration files but they don't appear to be the problem.  I take the
>>> DATE_FORMAT out and the problem goes away and data is properly returned
>>> to
>>> my jsp.
>>>
>>> Thanks!
>>>
>>> --
>>> View this message in context:
>>> http://www.nabble.com/Ibatis-crashing-MySQL-when-I-use-DATE_FORMAT-tf2245286.html#a6227542
>>> Sent from the iBATIS - User - Java forum at Nabble.com.
>>>
>>>
>> 
>> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Ibatis-crashing-MySQL-when-I-use-DATE_FORMAT-tf2245286.html#a6249363
Sent from the iBATIS - User - Java forum at Nabble.com.


Mime
View raw message