Advertisement
Help Keep Boards Alive. Support us by going ad free today. See here: https://subscriptions.boards.ie/.
If we do not hit our goal we will be forced to close the site.

Current status: https://keepboardsalive.com/

Annual subs are best for most impact. If you are still undecided on going Ad Free - you can also donate using the Paypal Donate option. All contribution helps. Thank you.
https://www.boards.ie/group/1878-subscribers-forum

Private Group for paid up members of Boards.ie. Join the club.

question for JDBC Oracle gurus

  • 06-02-2008 12:01PM
    #1
    Registered Users, Registered Users 2 Posts: 64 ✭✭


    Hi Folks,

    Hope someone can help here.

    I'm working on a program that, among other things, takes relatively large volumes of data e.g. thousands of lines and loads them to an Oracle database. Each line is passed to a Stored Procedure on the DB that does a bit of processing and inserts the line into a DB table.

    I'm calling the Stored Procedure from a J2EE environment. I'm trying to re-write the Java code to improve performance which is pretty poor at present.

    I was hoping to use some kind of batch processing using the oracle.jdbc.driver library using stuff like setDefaultExecuteBatch(), executeUpdate() and sendBatch().

    I have 3 questions really:

    1. However, this type of batch processing seems to only work with OraclePreparedStatement objects and not OracleCallableStatement objects - is this right?

    2. And because I am calling a Stored Procedure and not passing SQL directly to the DB, I have to use OracleCallableStatement and not OraclePreparedStatement - is this right?

    3. And if I am right in these 2 observations, has anyone any way to tackle batch processing using OracleCallableStatements?

    Thanks.


Comments

  • Registered Users, Registered Users 2 Posts: 995 ✭✭✭cousin_borat


    LinoRichie wrote: »
    Hi Folks,
    I was hoping to use some kind of batch processing using the oracle.jdbc.driver library using stuff like setDefaultExecuteBatch(), executeUpdate() and sendBatch().
    Thanks.

    I was faced with a somewhat similar problem some time ago for a client integration project.

    Instead of using JDBC directly installed Spring in the Apps lib on the Weblogic server hosting the J2EE app which was accessing Oracle 9i. Spring has a suite of JDBC convenience classes that take care of the transaction management and closing connections, etc etc. It should have the ability to do batch calls although I havent used that functionality directly.

    If you can't go that route then I can take a look at the JDBC stuff, theres a good book called "Oracle Database Programming using Java and Web Services" that covers the topic extensively.


Advertisement