Progress versus Oracle using sql statements in java

Posted on 2006-06-02
Last Modified: 2010-03-31
I am working with a progress database and eventually want to use JSP's to present all of the data, the issue that I am currently running into is that all of the sql that I know does not work with progress (was using oracle's database last.  Is there either a site that I can use to find all of the commands that work with progress in sql or would I be better off looking into something other than sql ?

Question by:AKnibbs
    LVL 30

    Accepted Solution

    Well its always better to remove the SQL query from Java code as much as possible. Either use a PreparedStatement so that the driver handles some of the formatting for you, or better use stored procedures so that the entire SQL is contained in them. What's more? You even get better performance.

    Author Comment

    I am using prepared statements, but can't seem to pull out the recid in the following code:
            String select = "Select RECID(PRO_DUCT)   from PRO_DUCT "
                      + "WHERE PRO_DUCT.ENTITY  = ? ";

             PreparedStatement pstmt = connection.prepareStatement(select);

            pstmt.setString(1, "person");
            rspstmt = pstmt.executeQuery();
            int count = 0;

            while( && count < 100)
                              System.out.println("num:" + count + ": " +rspstmt .getString("RECID(PRODUCT)")+ "   " );
    I know that recid returns a 4 byte value and have tried get float as well as getInt, getString was just the last thing I tried.

    Author Comment

    It seems as though all I had to do was to use getString(1) where 1 is the value's position in the output. (IE refer to it by column index)

    Featured Post

    6 Surprising Benefits of Threat Intelligence

    All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

    Join & Write a Comment

    Java had always been an easily readable and understandable language.  Some relatively recent changes in the language seem to be changing this pretty fast, and anyone that had not seen any Java code for the last 5 years will possibly have issues unde…
    Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
    Video by: Michael
    Viewers learn about how to reduce the potential repetitiveness of coding in main by developing methods to perform specific tasks for their program. Additionally, objects are introduced for the purpose of learning how to call methods in Java. Define …
    This tutorial covers a step-by-step guide to install VisualVM launcher in eclipse.

    746 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    16 Experts available now in Live!

    Get 1:1 Help Now