1

I am trying to add batches from a prepared statement for exact to 3000 times, but when executebatch() is called, the number of affected rows returned is 2048, and this happens for values add batch call statements greater than 2048. From where is the count 2048 is returned, I am unable to guess. Can someone please help me with this.

Here is my code for this:

    while (resultSet.next()) {
        for (int i = 0,j=0; i < noOfColumns && j < noOfColumns; i++) {
        //Setting values here for preparedStatement using setString()
        }
        pstmt.addBatch(); ==> this is called for more than 3000 times
        try {
            if(++count % batchSize == 0){
             updatedCnt=pstmt.executeBatch();  ==> Here batch size is set to 3000 and executebatch returns 2048
             successRowCnt = successRowCnt + updatedCnt.length;

            }
            if (count ==numberofRowsForCloning) {
                isResultMatch = false;
                break;
            }
        } 

    }
4

1 回答 1

1

Teiid驱动程序用于批量插入的默认限制为 2048。

来自 Doc
MaxPreparedInsertBatchSize 准备好的插入批次的最大大小。2048

尝试将属性配置为MaxPreparedInsertBatchSize您需要的大小。

请记住,这通常仅限于处理内存。

于 2018-11-09T10:53:10.607 回答