Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

java.sql. Connection prepareCall method

 
Tony Moses
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Sheriff
Posts: 21318
32
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 22
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic