1

I'm writing Java code to execute a batch of insert statements into an Oracle database. I've seen in some of the documentation (http://docs.oracle.com/cd/B28359_01/java.111/b31224/oraperf.htm) that I can use sendBatch() or executeBatch() to do this. I'm a little confused about what the differences between the two approaches are, or why I would choose on over the other. Maybe I just missed something in my readings.

Is there anyone who can clearly explain what the differences are, and how I can decide when I should use one approach instead of the other?

FrustratedWithFormsDesigner
  • 26,726
  • 31
  • 139
  • 202

1 Answers1

2

sendBatch() is the oracle version of batching. Oracle says using that is better fitting to oracle and gives higher performance. Oracle batching supports only PreparedStatement.

executeBatch() is the jdbc standard version. If your program should be jdbc compliant use that method for batching. It might be less performant (according to oracle documentation), but than you code is compatible with other jdbc drivers.

Christian13467
  • 5,324
  • 31
  • 34