Hello. I was just wondering as my testing seems to show it's ok but I'd like to confirm it. Could you declare a single callablestatement object at the start of the code...
then reuse it after each execute()? That should be ok, right? as each execute() in the transaction goes into jvm memory (surmising)? I'd hate to have to declare multiple CallableStatements. As I said, my testing seems ok with it but I'm not sure. Thank you.
Your code doesn't create a single CallableStatement object. It does declare a single CallableStatement variable, but then it creates three CallableStatement objects and assigns each of them (one at a time) to the single variable.
It's true that each of the three objects gets put into memory (there's no other place to put objects anyway) but that shouldn't be a big deal, since you've got tons of memory compared to what's required for a CallableStatement object. However you should make sure that you call close() on each of the three objects before you abandon them to be found later by the garbage collector, otherwise your database might have open resources which it has to clean up later after it notices they aren't being used any more.
What are you doing? You are supposed to be reading this tiny ad!
the new thread boost feature brings a LOT of attention to your favorite threads