Creating XML document from AS400 file
2 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Ed_Davison
Posted On:   Tuesday, February 17, 2004 11:31 AM

Hi, I need to code data retreived from an AS400 database file into XML format before encrypting it. We're currently running V4R4 of OS400 with JDK1.1.7. and the code needs to run on this platform. Can anyone give me any advice on how I should go about doing this? I know that there are XML parsers and builders available after V5.1 of OS400 but is there anything available as for V4R4? As for encryption is this possible on V4R4 at all? The plan is that a java application running on an AS400 will read data from an AS400 database file, put it in XML format, encrypt it and insert it into a DB2 database residing on an AIX box. A servlet running on a websphere server will then connect to this db2 database on the AIX box, decrypt the data,    More>>

Hi,

I need to code data retreived from an AS400 database file into XML format before encrypting it.
We're currently running V4R4 of OS400 with JDK1.1.7. and the code needs to run on this platform. Can anyone give me any advice on how I should go about doing this? I know that there are XML parsers and builders available after V5.1 of OS400 but is there anything available as for V4R4?
As for encryption is this possible on V4R4 at all? The plan is that a java application running on an AS400 will read data from an AS400 database file, put it in XML format, encrypt it and insert it into a DB2 database residing on an AIX box. A servlet running on a websphere server will then connect to this db2 database on the AIX box, decrypt the data, somehow, and then display the XML content.

Any suggestions anyone might have would be greatly appreciated, it seems that I'm running into walls with everything I try to do on V4R4.

   <<Less

Re: Creating XML document from AS400 file

Posted By:   Vicky_Berg  
Posted On:   Wednesday, March 10, 2004 12:32 AM

Hello,

I have the same Problem:

My .class-File (XMLtest.class) and jdom.jar are in the folder "javatest". If I call the XMLtest.class I get this message:
Java-program is continued with Code 1.

My Call-Statement ist
java 'CLASSPATH.:/JAVATEST/JDOM.JAR' 'javatest/XMLtest.class'
Can you help me please!

thx
Vicky

Re: Creating XML document from AS400 file

Posted By:   Alex_Pinsky  
Posted On:   Wednesday, February 18, 2004 11:16 AM

Hi Ed,

I'm using jdom.jar (copy this file to your AS/400 IFS and set CLASSPATH to point to this jar file).

We run it on a 5.1 bix but I don't see why you should have any problems to use it on 4.4 box.

1. From your java pgm open a JDBC connection to AS/400 database.

2. Execute SQL statement to get data from AS/400 file into ResultSet

3. Use XMLOutputter xmlOut = new XMLOutputter(" ", true) to create XML file

4. Create PrintWriter object to point to AS/400 IFS location as:

PrintWriter pw = new PrintWriter(new BufferedWriter(new FileWriter("/data/myxml/myfile.xml")));

Note that this path must exist on your AS/400 IFS and all directories in a path must have read/write access authorities.

5. Process your ResultSet and create correspondent XML Elements

6. After you done with ResultSet just say:

xmlOut.output(doc, pw);

pw.flush();

pw.close();

I'm not sure if encription classes available for 1.1.7 but you can always write your own encription class and use it to write XML data elements and attributes values
About | Sitemap | Contact