Hi.

One of solution is this:

<sqlMap namespace="MyObject">
  <insert id="PERSIST" parameterClass="List">
    INSERT INTO my_table (f1, f2, f3) VALUES
    <iterate open="(" close=")" conjunction=",">
        #[]#
    </iterate>
  </insert>
</sqlMap>

Above solution use java.util.List, I don't know that how to use the Object[].

2009/8/4 Stephen Scheck <steves...@yahoo.com>:
> Can iBATIS support simple positional parameters for inserts? I want to do
> something like:
>
> <sqlMap namespace="MyObject">
>   <insert id="PERSIST">
>     INSERT INTO my_table (f1, f2, f3) VALUES (?, ?, ?)
>   </insert>
> </sqlMap>
>
> executor.startBatch();
> for (int objNum = 0; objNum < MAX_OBJ_NUM; objNum++) {
>     Object[] args = new Object[] {
>         objNum,
>         val1,
>         val2
>     };
>
>     executor.insert("PERSIST", args);
> }
>
> executor.executeBatch();
> // etc
>
> In the real case that I'm trying to implement, my fields come from several
> sources and I'd
> prefer to avoid creating an inner class just to make the data conform to a
> JavaBean.
>
> Thanks.
>
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: user-java-unsubscr...@ibatis.apache.org
For additional commands, e-mail: user-java-h...@ibatis.apache.org

Reply via email to