ibmi-brunch-learn

Announcement

Collapse
No announcement yet.

Problem with JT400/JDBC and QTEMP files

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Problem with JT400/JDBC and QTEMP files

    Hello,

    Im using the jt400 in my rpg program. Im trying to extract records from any file.

    It's working great, except when I try to extract records from qtemp.

    Java exception "**UNKNOWN ERROR**" when calling method "executeQuery" with
    signature "()Ljava.sql.ResultSet;" in class "java.sql.PreparedStatement".

    Pointer not set for location referenced.

    Is there any restrictions when trying to query qtemp. That's the only time it's bombing ...

  • #2
    Re: Problem with JT400/JDBC and QTEMP files

    Each job on the system has its own QTEMP. So, this is not a normal library, each job that is running has a different QTEMP, and they can only access their own QTEMP.

    Remember that when you use JDBC, you are connecting to a database server job. So, that server will have a different QTEMP from your job that is calling it. So if you created temporary objects in QTEMP of your job you will not be able to access them via JDBC.

    However, if they were created entirely within the server job, I would expect it to work.

    Can you explain the situation a bit more?

    Comment


    • #3
      Re: Problem with JT400/JDBC and QTEMP files

      It's a batch job running. We have a program that will create the file and a jdbc/poi program that builds a spreadsheet.

      Is there anyway using an activation group that I can capture the file?

      Comment


      • #4
        Re: Problem with JT400/JDBC and QTEMP files

        I'm not sure how an activation group relates to this?!

        Is your program coded in Java? If so, all I can think of is to put the file somewhere else besides QTEMP.

        If your program is coded in RPG, then I would suggest reading the file using embedded SQL or native I/O instead of JDBC.

        Comment


        • #5
          Re: Problem with JT400/JDBC and QTEMP files

          It's an RPGLE program with the jdbc prototypes. We wanted a single program that would read any file with any number of columns and produce a POI spreadsheet.

          That is really BIG drawback to IBM JDBC to not be able to use QTEMP. They should have considered that. Most programmers use qtemp as a batch workfile creation library.

          I thought of using SQL/RPG but couldnt find a way to iterate over an unknown amount of columns. So I was stuck with JDBC.

          Comment

          Working...
          X