ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stephen Scheck <steves...@yahoo.com>
Subject Positional Parameters
Date Tue, 04 Aug 2009 04:54:09 GMT
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.


      
Mime
View raw message