In the meantime the open office document is changed to be in sync with
the actual iBATIS implementation. So insert does not return the number
of inserted rows. From the javadocs:
Executes a mapped SQL INSERT statement. Insert is a bit different from
other update methods, as it provides facilities for returning the
primary key of the newly inserted row (rather than the effected rows).
This functionality is of course optional.
The parameter object is generally used to supply the input data for the
INSERT values.
@param id The name of the statement to execute.
@param parameterObject The parameter object (e.g. JavaBean, Map, XML etc.).
@return The primary key of the newly inserted row. This might be
automatically generated by the RDBMS, or selected from a sequence table
or other source.
@throws java.sql.SQLException If an error occurs.
Regards,
Sven
Cornel Antohi wrote:
Hi,
We experienced the same "strange" problem and we decided, until IBatis team will
implement the insert as in documentation, to use "update" option from xml files with an
INSERT sql query.
Thank you,
Cornel
----- Original Message -----
From: Krishnamoorthi, Sruthi (Raytheon)
To: [email protected]
Sent: Friday, March 10, 2006 7:41 PM
Subject: Urgent help required
The docs says
int rows = sqlMap.insert ("insertProduct", product);
returns a int value
When I code it ,the return value is object. I am not able to get the int
return value. Please help me out.
Thanks,
Sruthi Krishnamoorthi
703-562-9732(Work)
537 A - (Raytheon) Location