• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Batch Updates

 
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am thinking about using Batch updates (i.e. stmt.executeBatch() ) but I am not quite understanding the advantages. I read in http://java.sun.com/docs/books/tutorial/jdbc/jdbc2dot0/batchupdates.html that " ... Sending multiple update statements to the database together as a unit can, in some situations, be much more efficient than sending each update statement separately.
My question(s) is: What do they mean "...in some situations..." batch updates would be efficient? Is there an example of where it would not be efficient to use it?
I am using the standard JDBC-ODBC driver connecting to an access database. Did anyone have any problems that I will encounter?
Thanks for your help in advance.
Allen
 
author
Posts: 3252
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Allen Thomas:
What do they mean "...in some situations..." batch updates would be efficient? Is there an example of where it would not be efficient to use it?

It is not efficient when database performance is not the bottleneck in the first place. It is not efficient when the individual updates in the batch take a long time compared to the time it takes to communicate with the database. It is very efficient when you have a whole bunch of little updates that execute very quickly individually but together take a significant time.

I am using the standard JDBC-ODBC driver connecting to an access database. Did anyone have any problems that I will encounter?

In that case I'd be tempted to say: don't bother. If you run into performance problems then your #1 optimisation would be to move away from both Access and the JDBC-ODBC bridge.
- Peter
 
Allen Thomas
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks Peter.
 
It's a tiny ad. At least, that's what she said.
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic