This week's book giveaway is in the Clojure forum.
We're giving away four copies of Clojure in Action and have Amit Rathore and Francis Avila on-line!
See this thread for details.
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Batch Updates

 
Allen Thomas
Greenhorn
Posts: 29
  • 0
  • Mark post as helpful
  • send pies
  • 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
 
Peter den Haan
author
Ranch Hand
Posts: 3252
  • 0
  • Mark post as helpful
  • send pies
  • 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
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Peter.
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic