I agree with Brandon on this one....especially because it happens with iBATIS 1.x and 2.x, which are about as different as iBATIS vs. JDBC. 

I'd be very surprised if this turned out to be iBATIS.  It's most likely the JDBC driver.  Think about it this way though:  _no_ client should be able to crash a server.  Period.  ;-)

Cheers,
Clinton

On 9/9/06, Brandon Goodin <brandon.goodin@gmail.com> 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.