Interesting.  Will check into this.

When I click on "Programmer's Guide' from,
I get The page you requested cannot be displayed error.


-----Original Message-----
From: java400-l-bounces@xxxxxxxxxxxx
[mailto:java400-l-bounces@xxxxxxxxxxxx] On Behalf Of Joe Pluta
Sent: Friday, December 30, 2005 11:52 AM
To: 'Java Programming on and around the iSeries / AS400'
Subject: RE: Generic java class that will allow RPG/RPGSQLE program
toaccessnon-iSeries Data

I've got an idea, Lim.  How about defining a data structure that you
pass a pointer to.  The data structure looks like this:

d SQLVar          ds                                   
d   vartype                      3u 0                  
d   alphavar                    64                     
d   binary                      20u 0 overlay(alphavar)
d   decimal                     30s15 overlay(alphavar)
d   logical                       n   overlay(alphavar)

Your getColumn routine would take a pointer to this data structure, and
then would load the data depending on the column type.  The vartype
field would get set to identify the type of data coming back.

Obviously my little data structure has some specific limitations, such
as a maximum alpha field size of 64.  You'd have to set the limits as
you saw fit.  You might also want to have an error code field just in
case (for example, if you had a data type such as BLOB that you couldn't
handle or if the data exceeded your limits).

This is about the cleanest way I can figure out how to do this.  Your
application would call the service program's getColumn method with the
column index (or name) and a pointer to this structure.  Your service
program would be responsible for passing the data structure to the Java
method as an array of 3u0 bytes, and the Java method would get the
column value into a Java variable using standard JDBC routines and then
use an appropriately initialized AS400Structure object to convert the
Java variable (along with the varitype field and any other information)
into the array of bytes.


As an Amazon Associate we earn from qualifying purchases.

This thread ...


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

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