On 25-Jun-08, at 2:32 PM, Dott. Christian OLIVIERI wrote:
Hi, this is my problem:
I want create a single java procedure to update a field on
different table. For the reading statement all is right but for the
update not.
The xml file hold the following code:
<update id="setlocker">
$query$
</update>
And the Java code is
String strStr = "UPDATE REGION SET locked='[EMAIL PROTECTED]' WHERE ID=10";
mapToGiveIbatis = new java.util.HashMap(1);
mapToGiveIbatis.put("query", strStr);
Putting the SQL inline in your code basically defeats the purpose of
using iBATIS. What's probably screwing this up is string quoting. Put
the query in your map and use parameters.
--Toby
ourutils.utils.sqlMap.update("setlocker", mapToGiveIbatis);
No errors and no exceptions thrown but my table was not updated.
Where I'm wrong?