Progress versus Oracle using sql statements in java

Posted on 2006-06-02
Medium Priority
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
  • 2
LVL 30

Accepted Solution

Mayank S earned 200 total points
ID: 16823754
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

ID: 16915508
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(rspstmt.next() && 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

ID: 16915932
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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Are you developing a Java application and want to create Excel Spreadsheets? You have come to the right place, this article will describe how you can create Excel Spreadsheets from a Java Application. For the purposes of this article, I will be u…
Java functions are among the best things for programmers to work with as Java sites can be very easy to read and prepare. Java especially simplifies many processes in the coding industry as it helps integrate many forms of technology and different d…
Viewers learn how to read error messages and identify possible mistakes that could cause hours of frustration. Coding is as much about debugging your code as it is about writing it. Define Error Message: Line Numbers: Type of Error: Break Down…
Viewers will learn about basic arrays, how to declare them, and how to use them. Introduction and definition: Declare an array and cover the syntax of declaring them: Initialize every index in the created array: Example/Features of a basic arr…
Suggested Courses

621 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