|
Hi gang... I'm having one heckuva time trying to debug a Java UDTF in DB2. I have written a program to connect to an Oracle server, execute a query and return the result set as an SQL UDTF. When run in the STRSQL interface I receiving a QRY2293 (Query can not be run) message. Drilling down, the message is that the program did not return quickly enough, thus DB2 timed out. I have done the following to ensure that I have this right: 0) Created a QAQQINI file and altered the UDF_TIME_OUT parameter so as to allow five minutes instead of the default 30 seconds. Then I issued the CHGQRYA to point in the right file. The result is a loss of five minutes of my life (that I'll never recover) with no change in the error. 1) Entered, compiled and ran the source code from "IBM Developer Kit for Java", page 135. That was successful so it proves that I have my development environment set correctly and I at least know enough to get a UDTF done properly. 2) Stripped out the UDTF code and wrapped a main procedure around everything, compiled and ran it from my laptop. This confirms that the program is correct, all of the connection properties are correct and that I'm able to get a result set from the Oracle database. Total time to the first record returned is less than five seconds. 3) did an CALL SQLJ.REMOVE_JAR on the Oracle jdbc jar file, then tried running my query again. This time I do get an error returned that it was unable to find the Class for the Oracle connection. This confirms that my code is actually getting called. 4) Stripped the DB connection code from the UDTF program and had it return an immediate EOF condition. This worked as expected and an empty list was returned to me via the STRSQL interface. My normal course of action would be to add a few System.out.printlns to get a feel for what's happening (and I actually did that) but I'm unable to find the output... since the database is actually executing the code. I'd be happy to use IBM's debugger for the task but I'm unable to determine the job I'd need to connect to to actually do that. The aforementioned manual gives all kinds of nice information on debugging a Java program but they all require you to know the job. In short, I'm at an impasse now. Can anyone who has tread this path before point me in the right direction. If I'm missing something obvious please feel free to beat me across the head with a clue-by-four. Thanks! Barry
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2025 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.