Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8181447
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T00:31:31+00:00 2026-06-07T00:31:31+00:00

I am using the following code to connect to an Oracle stored procedure, with

  • 0

I am using the following code to connect to an Oracle stored procedure, with an average for the jdbcExecutionTime of 860ms, and the execution plus serialization time of 172ms.

The jdbcExecutionTime concerns me, and I know it can be done much faster, but from what I’ve read CallableStatement is supposed to be the fastest.

Any hints for improving the performance here?

Also: I’m using Oracle 11 with ojdbc14.jar.

final long jdbcStartTime1 = System.currentTimeMillis(); 
    final long jdbcEndTime1;
    final long jdbcEndTime2;
    Connection con = null;

    logger.info("Loading properties...SYS TIME:"+System.currentTimeMillis());

    InputStream inputStream = blah.class.getClassLoader().getResourceAsStream("properties/jdbc.properties");
    logger.info("Done loading properties...SYS TIME:"+System.currentTimeMillis());
    try {

        PROPERTIES.load(inputStream); //Load the jdbc properties
        Class.forName(PROPERTIES.getProperty("jdbc.driverClassName")).newInstance(); //Load the oracle driver
        //Set the connection 
        logger.info("Starting JDBC connection...SYS TIME:"+System.currentTimeMillis());
        con = DriverManager.getConnection(PROPERTIES.getProperty("jdbc.url"), PROPERTIES.getProperty("jdbc.username"), PROPERTIES.getProperty("jdbc.password"));
        ((OracleConnection)con).setDefaultRowPrefetch(80);

        logger.info("JDBC connection established...SYS TIME:"+System.currentTimeMillis());

        String jobquery =   "{call PKG_TEST.MY_PACKAGE(?,?,?,?,?,?)}";  
        CallableStatement callStmt = con.prepareCall(jobquery);

        callStmt.setString(1,blah);                     
        callStmt.setBoolean(2, blah2);
        callStmt.registerOutParameter(3, OracleTypes.CURSOR);   
        callStmt.registerOutParameter(4, OracleTypes.CURSOR);   
        callStmt.registerOutParameter(5, OracleTypes.CURSOR);   
        callStmt.registerOutParameter(6, OracleTypes.CURSOR);   

        jdbcEndTime1 = System.currentTimeMillis();

        logger.info("Executing stored procedure...SYS TIME:"+System.currentTimeMillis());
        callStmt.execute();
        logger.info("Stored procedure complete...SYS TIME:"+System.currentTimeMillis());

        logger.info("Storing db cursor objects as result sets...SYS TIME:"+System.currentTimeMillis());
        ResultSet cur1 = (ResultSet)callStmt.getObject(3);
        ResultSet cur2 = (ResultSet)callStmt.getObject(4);
        ResultSet cur3 = (ResultSet)callStmt.getObject(5);
        ResultSet cur4 = (ResultSet)callStmt.getObject(6);
        logger.info("Completed storing cursors...SYS TIME:"+System.currentTimeMillis());

        jdbcEndTime2 = System.currentTimeMillis();

        final long jdbcExecutionTime =  (jdbcEndTime1-jdbcStartTime1);
        final long spEx_ResultSetTime = (jdbcEndTime2-jdbcEndTime1);
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-07T00:31:34+00:00Added an answer on June 7, 2026 at 12:31 am

    The first time you do this, most of the time will be spent loading the library (which only happens when you use it for the first time) and creating the connection. Once you have an existing connection you should expect around a <10 ms delay (longer than what you are doing)

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am using following code to create new wifi access point and to connect
I'm using the following code↓ to connect to a ftp server and get a
I am using the following C# code to connect to active directory and validate
I am trying to connect database.sdf on same director. Using following code but gives
I have the following code to connect to my office 365 account using powershell:
I am using following code to connect with WPA2 in android (I can connect
When using the following code to connect to the toggl api I connect and
I'm using the following code to connect to remote machine using WMI: ConnectionOptions connOptions
I am trying to connect to an Oracle database via JDBC. Using the following
I am using the following code in Titanium Appcelerator to connect with remote Host:

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.