File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes JDBC and Relational Databases and the fly likes java.sql. Connection prepareCall method Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC and Relational Databases
Bookmark "java.sql. Connection prepareCall method" Watch "java.sql. Connection prepareCall method" New topic

java.sql. Connection prepareCall method

Tony Moses

Joined: Aug 21, 2002
Posts: 22
I am supporting a J2EE application that is performing extremely poorly. The following lines of code are taking in excess of 1 1/2 hrs to execute:

statement = connection.prepareCall("{ call setInventoryLevels() }");

I have read that the prepareCall method is very heavy and does not perform well. Are there any alternatives or is it possible that the stored procedure itself is slowing down the process?

Paul Clapham

Joined: Oct 14, 2005
Posts: 19973

It shouldn't be too hard to put some timing code into your program to find out how long each of those two statements runs for. Why don't you try that first? That would get rid of the rumours and put control back in your hands.
Tony Moses

Joined: Aug 21, 2002
Posts: 22
Thanks. I have pinpointed the bottleneck/slowdown:

statement.execute(); is taking 1 1/2 hours to complete. I am assuming at this point that my slowdown is originating in the way the Stored Procedures were written.
I agree. Here's the link:
subject: java.sql. Connection prepareCall method
It's not a secret anymore!