Comments on: SQL in Java: To batch or not to batch with Oracle JDBC https://technology.amis.nl/2007/12/07/sql-in-javal-to-batch-or-not-to-batch-with-oracle/ Friends of Oracle and Java Wed, 08 Jul 2015 07:37:03 +0000 hourly 1 http://wordpress.org/?v=4.2.3 By: Emiel Paasschens https://technology.amis.nl/2007/12/07/sql-in-javal-to-batch-or-not-to-batch-with-oracle/#comment-5076 Sun, 16 Dec 2007 14:27:48 +0000 http://technology.amis.nl/blog/?p=2652#comment-5076 @TongucY: The uploading is part of a synchronization process. The synchronization is not straight forward, it involves also lots of extra tables (link, history and log tables) and also an Excel sheet has to exported with all the data changes (sheet per table). Because the incoming data is delivered as pure SQL insert statements into import tables, the fist option I used was adding these complete insert statements as JDBC batch statements and execute them.

]]>
By: TongucY https://technology.amis.nl/2007/12/07/sql-in-javal-to-batch-or-not-to-batch-with-oracle/#comment-5075 Fri, 14 Dec 2007 13:59:13 +0000 http://technology.amis.nl/blog/?p=2652#comment-5075 If you need/want performance, he is my experience to share;

1. No “SQL in Java” -> package your database calls on pl/sql, and just callable statements within java.

2. No “To batch or not to batch with Oracle JDBC” -> pl/sql bulk operations for batches, and again just callable statements within java.

If you are doing data intensive operations finish the task within the kernel, database itself. And SQL is the native language of databases not Java.

Best regards.

]]>
By: Zeger Hendrikse https://technology.amis.nl/2007/12/07/sql-in-javal-to-batch-or-not-to-batch-with-oracle/#comment-5074 Mon, 10 Dec 2007 15:58:19 +0000 http://technology.amis.nl/blog/?p=2652#comment-5074 Recently I had to do exactly the same: parse hundred thousands of records from file to a database. To keep the performance acceptable, we had to process the file as a stream and to apply JDBC batching, precisely in the way you described. However, we soon ran into java.lang.OutOfMemory errors, due to the PreparedStatement growing beyond bounds (containing the batch with hundred thousands of records). For those who are interested in our solution, see my post Tackling JDBC incurred memory problems using JMX.

]]>
By: Marco Gralike https://technology.amis.nl/2007/12/07/sql-in-javal-to-batch-or-not-to-batch-with-oracle/#comment-5073 Mon, 10 Dec 2007 15:18:40 +0000 http://technology.amis.nl/blog/?p=2652#comment-5073 Emiel kun je me een plezier doen en je font style aanpassen naar “default”. Alles (de site) gaat nu mee in jou fontstyle zoals je ziet…

]]>
By: Patrick Wolf https://technology.amis.nl/2007/12/07/sql-in-javal-to-batch-or-not-to-batch-with-oracle/#comment-5072 Sun, 09 Dec 2007 18:25:58 +0000 http://technology.amis.nl/blog/?p=2652#comment-5072 Parameter binding rules 😉

Patrick

]]>
By: rekounas https://technology.amis.nl/2007/12/07/sql-in-javal-to-batch-or-not-to-batch-with-oracle/#comment-5071 Fri, 07 Dec 2007 20:14:27 +0000 http://technology.amis.nl/blog/?p=2652#comment-5071 For performance purposes, if you were repeating the same statement 200,000 times, you should have been using PreparedStatement from the start.

In general, I like the PreparedStatement object better because I just find it cleaner to use.

]]>
By: Emiel Paasschens https://technology.amis.nl/2007/12/07/sql-in-javal-to-batch-or-not-to-batch-with-oracle/#comment-5070 Fri, 07 Dec 2007 17:41:24 +0000 http://technology.amis.nl/blog/?p=2652#comment-5070 Just as a final remark.
The rest of the article of O-Reilly is also quite interesting.

]]>