× 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.



Larry,

This seems more complicated than it has to be. Why not just let the
Java program handle XML and SQL? There will be no performance gain from
RPG in this case and Java is very good at processing XML and working
with dynamic SQL. You could still use an RPG program to kick off the
process. It could be as simple as rpg calls a Java program passing the
stream file name. Then the Java program opens the stream file, parses
the XML and loops through the DOM tree adding records. When this is done
return the number of records added or something else that is
meaningful.

David Morris

>>> larry_ducie@xxxxxxxxxxx 9/17/2004 9:47:37 AM >>>
Hi everybody,

I seem to be having one of those days!

Today I have been writing a RPGLE program to call java routines to
convert 
xml into SQL insert statements. This program would then call a SQLRPGLE

program to perform the database transactions.

Pgm1 contains the java calls and creates a SQL transaction in a stream
file.

Pgm2 is a SQLRPG program that opens the stream file and reads it into a
32k 
field. I then attempt to prepare the statement, ready to execute.

Now, I'm creating the file OK, but the prepare fails. That's fine - I
didn't 
expect it to work first time. (I'm not exactly a SQL guru)

However, for some reason, the job just up and ends on me. This occurs
while 
I'm debugging through the programs. Both programs are running in the
same 
named activation group. We are on V5R2M0...

...Neither of my programs use pointers explicitly. I pass the address
of a 
variable for my stream file read, that's all. Surely not enough to
cause a 
job to crash.

The only other point to note is that I haven't freed my java object 
references prior to the call of the SQLRPGLE program. That code will be

going in once I've got the programs working. Sigh...

Any help would be much appreciated. Even an example of a multiple
insert 
transaction would be VERY helpful - get my prepare working. :-)

This is a very easy way to convert received xml into database data -
once 
I've got it working I'll happily send the working code to anybody who'd
be 
interested.

Cheers and TIA

Larry Ducie


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-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.