• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JDBC Prepared Statement BatchStatement within a while loop

 
Ravi Kiran Va
Ranch Hand
Posts: 2234
Eclipse IDE Firefox Browser Redhat
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi ,

I was told not to insert data in databse with in while loop .

Within while loop i am calling database method to insert record in a Table





Will the above will be treated as a Batch statement ??

Please reply ,
Thanks in advance
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 35279
384
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Kind of. The list will be batched. It would be better to accumulate all the lists in your outer while loop though.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic