Hi,

I got a simple procedure which only have a single insert statement in it.

From the JAVA, I want to insert a batch record, so I use CallableStatemetn.addBatch to execute the procedure.

But after run the program, only one record get inserted. If I use prepareStatement to execute insert query, addBatch is working fine.

Here is my code
CallableStatement iCS = con.prepareCall("call iFT(?,?)") ;
iCS.setString(1,"Emp1");
iCS.setDate(2,new java.sql.Date(103,1,1));
iCS.addBatch();

iCS.setString(1,"Emp2");
iCS.setDate(2,new java.sql.Date(103,12,12));
iCS.addBatch();

iCS.executeBatch();


----------------
procedure:

CREATE PROCEDURE iFT(
IN EMP_NAME VARCHAR(20),
IN EMP_DOB DATE
)
SPECIFIC iFT
LANGUAGE SQL
BEGIN ATOMIC
DECLARE UNDO HANDLER FOR SQLEXCEPTION, SQLWARNING
INSERT INTO employee(NAME,DOB) values (EMP_NAME,EMP_DOB);
END
;


Is it something wrong with my code or db2 not support procedure addBatch?