Re: Strange behavoir of batches

Поиск
Список
Период
Сортировка
От Oliver Jowett
Тема Re: Strange behavoir of batches
Дата
Msg-id 4325FA5D.2060402@opencloud.com
обсуждение исходный текст
Ответ на Strange behavoir of batches  (Angelo Neuschitzer <an@jenomics.net>)
Ответы Re: Strange behavoir of batches
Список pgsql-jdbc
Angelo Neuschitzer wrote:

>> PreparedStatemet pStmt = con.prepareStatement("INSERT INTO table_a
>> VALUES (...)");
>> for(0 to 93)
>> {
>>    [fill values into pStmt]
>>    if(not last row)
>>    {
>>       pStmt.addBatch();
>>    }
>> }
>> pStmt.executeBatch();
>> pStmt.clearBatch();

AFAIK, this "not last row" logic seems wrong. Calling executeBatch()
only executes those queries that have been added to the batch via
addBatch(), so the loop will lose the last INSERT.

-O

В списке pgsql-jdbc по дате отправления:

Предыдущее
От: Heikki Linnakangas
Дата:
Сообщение: Re: XADataSource implementation
Следующее
От: Oliver Jowett
Дата:
Сообщение: Re: Strange behavoir of batches