ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Kasatkin Konstantin" <...@estylesoft.com>
Subject Problem to get the final SQL query text from the DaoTemplate
Date Tue, 10 Oct 2006 07:11:08 GMT
Hello guys, 
I've been using iBatis about a year and had no problems till now. 
I have an following issue (I'll begin at the root problem): 

I use MySQL server as DB engine, it produces messages like "Duplicate entry 'SOME VALUE' for
key 3" 
on unique constraints. The problem is, if I have, for instance, three unique indices in one
I perform INSERT query that populates all the fields by record, then I catch exception and
there is no way to know, whick index has generated the message. I only see its number.

If I've had the possibility to get the text of the sql statement that has jast executed I
extract Table Name from it, return key sequence for this table and find out the name of
correcponding index.

I've dug the whole source code and couldn't find a way to extract sql query text. 

Maybe there is some way to get the SQL query text from a DaoTemplate? 

View raw message