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



Hi David,

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

Yep, you're right. I've already written it in java and it runs a dream.

Well, actually, I've got two examples written in java:

1) Uses a default handler and a class that encapsulates each of the files. I
then parse the xml and populate the field values via setter methods. Once
done I use apreppared statement with parameter markers and then use the
getters to populate the statement and run.

2) Uses a transformer object to transform the xml to sql insert statements.
After connecting to the database these statements are then executed.

However, I'm the only person in our shop who is currently coding in java
(after a 1-week course and buying a LOT of boooks). Consequently, I keep
being given work like above (xml generation, or xml -to- database
conversions). I then write it in java, optimise it, and present it. I always
seem to end up writing a RPG equivalent that goes into production because
"nobody else can maintain the code".

I'm hoping that I can get this thing working and (for the first time in my
career) I want the java version to be quicker. I can then put my java
solution live on the basis of performance, and management will just have to
train more people to maintain my code. :-)

Cheers

Larry


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.