Comment 2 for bug 1315527

Revision history for this message
xiu-zhu.zhang (xiu-zhu-zhang) wrote :

JDBC_TYPE4:
Batch operation failed by statement of 'insert into table values(?,?,?,?),(?,?,?,?),(?,?,?,?)' on below loop over one time;

The procedure:
PreparedStatement pStmt = null;
insert = "insert into table values(?,?,?,?),(?,?,?,?),(?,?,?,?)";
for (int j = 0; j < 1; j++) {
                pStmt.setString(1, "QA");
                pStmt.setInt(2, prm);
                pStmt.setInt(3, points);
                pStmt.setString(4, DEPT);

                pStmt.setString(5, "QA");
                pStmt.setInt(6, prm);
                pStmt.setInt(7, points);
                pStmt.setString(8, DEPT);

                pStmt.setString(9, "QA");
                pStmt.setInt(10, prm);
                pStmt.setInt(11, points);
                pStmt.setString(12, DEPT);

                pStmt.addBatch();
}
pStmt.executeBatch();
This scenario will insert three records into table on loop one time.

On the side it will failed on pStmt.addBatch() over one time.
Here is the error from SQL side:
ERROR[30025] The ATOMIC and NOT ATOMIC clauses can be used only in a rowset INSERT statement.