JDBC Call to Oracle Package Ignoring Execution Plan

Hi,

We are experiencing some performance issues when calling an Oracle Package from Java EJB Code using the Oracle JDBC driver on a Oracle 10.1.3.1 Application Server.

Using the Oracle Package the call takes around an minute and appears to ignore the Execution Plan, however calling the package from sqlplus it only takes a couple of seconds and uses the execution plan.

Has anyone experienced this before when using the Oracle JDBC driver?

Regards,

Dave

[491 byte] By [davemeiklea] at [2007-11-27 3:50:20]
# 1
I think you are using JDBC call on statement then it will ignore Action Plan.Try using Prepared Statement for execution of queries then you will be able to see the action plan usage.
ShivaKatulaa at 2007-7-12 8:54:15 > top of Java-index,Database Connectivity,Java Database Connectivity (JDBC)...
# 2
Might help to provide actual details of how you are running it.
jschella at 2007-7-12 8:54:15 > top of Java-index,Database Connectivity,Java Database Connectivity (JDBC)...
# 3
PreparedStatement stmt = null ; stmt = con.prepareStatement("INSERT INTO TEST VALUES(?)"); stmt.setString(1, "Shiva"); stmt.execute();
ShivaKatulaa at 2007-7-12 8:54:15 > top of Java-index,Database Connectivity,Java Database Connectivity (JDBC)...
# 4
> PreparedStatement stmt = null ;> stmt = con.prepareStatement("INSERT INTO TEST> VALUES(?)");I am rather certain that that is not an oracle package.
jschella at 2007-7-12 8:54:15 > top of Java-index,Database Connectivity,Java Database Connectivity (JDBC)...
# 5

> [code]

> PreparedStatement stmt = null ;

> stmt = con.prepareStatement("INSERT INTO TEST

> VALUES(?)");

>stmt.setString(1, "Shiva");

> stmt.execute();

> /code]

How are you relating this to an Oracle Package? There is one and only one "execution plan" for an insert statement no matter where it is called or how it is called. The more you share the less sense your original question makes. To get real help you will probably have to share your intent, your code and your problem in more detail.

WorkForFooda at 2007-7-12 8:54:15 > top of Java-index,Database Connectivity,Java Database Connectivity (JDBC)...