aspose file tools*
The moose likes JDBC 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
Bookmark "java.sql. Connection prepareCall method" Watch "java.sql. Connection prepareCall method" New topic
Author

java.sql. Connection prepareCall method

Tony Moses
Greenhorn

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:

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

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?

Thanks.
Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 18904
    
    8

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
Greenhorn

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: http://aspose.com/file-tools
 
subject: java.sql. Connection prepareCall method