× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



Thorbjørn Ravn Andersen wrote:
So what I am trying to do is not as such calling _from_ Java but _through_ SQL, so it is essentially DB2/400 I want to talk correctly to my Cobol program. I can do this easily directly with a ProgramCall in Java but I wanted to see if there was any benefits in accessing our "you must go through THIS program to talk to our legacy system"-program using the pooling and caching mechanisms of DB2 and JDBC pools (plus it allows us to use any programming language with a database driver).
We're at a point of guessing how the JDBC driver works, so I'm a little out of my league,. but I did notice something. It LOOKS like for some reason the parameters are being passed correctly, except with a leading plus sign. For example, your first iteration through the loop you should be passing 1 in the first parameter and 25 in the second. With leading plus signs, that's X'41F0F0F0F0F1' and X'41F0F0F0F2F5'. Remove the last character, and this matches exactly what you're seeing.

Why? I don't know. I suggest one thing to further test, and a workaround:

1. To further test, change your input parameters to character values of length seven or more and see what you get. My guess is you will see the hex values I mentioned above.

2. A workaround, unsatisfactory though it may be, is to use character fields. It's relatively easy if you won't be passing negative numbers. Just format the integer into a five-character alpha field with leading zeros and that will be the same as a zoned decimal field.

While discussing with you helpful folks I am playing with WSDCi to see if ILE Cobol gives better results or similar :)

You might also try using an RPG program as your stored procedure and see if you get the same results. I'm amazed that this doesn't work.

Joe

As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:
Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 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.