Skip to Main Content

Java Database Connectivity (JDBC)

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Interested in getting your voice heard by members of the Developer Marketing team at Oracle? Check out this post for AppDev or this post for AI focus group information.

PreparedStatement.executeQuery slow

RP24Feb 28 2018 — edited Mar 2 2018

Hey,

I am using AppDynamics to instrument the code I have seen often in the reports that PreparedStatement.executeQuery(), PreparedStatement.executeUpdate(),  resultsSet.next() is very slow taking close to 350, 500 ms whereas the query takes only 10, 15 ms.

I am not sure what is causing slowness within PreparedStatetment.

Any pointers?

The database is oracle. Also we are using DBCP 1.4 connection pool

public ResultSet executeQuery(PreparedStatement statement)

   {

     ResultSet results = null;

     try

    {

       results = statement.executeQuery();   

     }catch(Exception e){

          //Exception handling

     }

return results;

}

}

Thanks!

Comments

Locked Post
New comments cannot be posted to this locked post.

Post Details

Locked on Mar 30 2018
Added on Feb 28 2018
4 comments
4,614 views