Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Batch Execution Solution

 
Sant Manchala
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Issue:

1)If we try to execute 5000 statements using java batch update by preparedstatements on oracle database , is there any chance to track the statement which has issues while executing that batch update

below code adds all the insert statements into prepared statement and executes the batch once the count reaches 5000 count

this the code i was using

ps.addBatch();
batchCtr++;

if(batchCtr >= 5000){

int[] count= ps.executeBatch();
log.info("Executed the count using batch"+count.length+"projectnumber--"+str);
batchCtr = 0;
}


 
Rob Spoor
Sheriff
Pie
Posts: 20511
54
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

Please read your private messages regarding an important announcement.

Thank you,

Rob

Also, please Use Code Tags.
 
Balu Sadhasivam
Ranch Hand
Posts: 874
Android Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


This might give some idea.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic