?
Solved

need to convert CLOB sxml data to xml files

Posted on 2009-04-22
6
Medium Priority
?
259 Views
Last Modified: 2012-05-06
Hi,

In my JSP code I want to convert the clob data(in xml format) to XML file which can be stored in any directory .
I am pasting my XML data which is there in CLOB.
please provide the solution asap.
Thanks,
Rama
<chart xaxisname="Ethnic Origin" yaxisname="Employees" palette="4" decimals="0" enableSmartLabels="1" enableRotation="0" bgColor="99CCFF,FFFFFF" bgAlpha="40,100" bgRatio="0,100" bgAngle="360" showBorder="1" startingAngle="250">
<set label="American Indian or Alaska Native (Not Hispanic or Latino)" value="11"/>
<set label="Asian (Not Hispanic or Latino)" value="14"/>
<set label="Black or African American (Not Hispanic or Latino)" value="50"/>
<set label="Hispanic or Latino" value="22"/>
<set label="Native Hawaiian/Other Pacific Islander(Not Hispanic/Latino)" value="5"/>
<set label="White (Not Hispanic or Latino)" value="257"/>
<set label="" value="273"/>
</chart>

Open in new window

0
Comment
Question by:ramadevimandala
  • 3
  • 3
6 Comments
 
LVL 12

Expert Comment

by:Gibu George
ID: 24204000
Hello ramadevimandala,
Use an output stream and write it to file.


Regards,

gibu_george
0
 

Author Comment

by:ramadevimandala
ID: 24204451
Hi,
I have already tried in that way, here is my code. but this is not generating the file in current dir .
here xmlVal is the CLOB
long  v_len          = xmlVal.length();
          xmlValbuff = xmlVal.getSubString(1,(int)v_len);
          byte[] b=xmlValbuff.getBytes();
          try{        
            FileOutputStream output = new FileOutputStream(new File("FirstChartData.xml"));
            output.write(b);
            output.flush();
            output.close();
          } catch (IOException e) {
              System.out.println("IOException " + e.getMessage());
          }

please tell me if I am wrong
0
 
LVL 12

Expert Comment

by:Gibu George
ID: 24204755
Is there any exceptions?
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:ramadevimandala
ID: 24204785
No not getting any execption
0
 
LVL 12

Accepted Solution

by:
Gibu George earned 750 total points
ID: 24204798
try giving an absolute path like c:/FirstChartData.xml
0
 

Author Comment

by:ramadevimandala
ID: 24205050
Hmmm, my code was generating XML but OC4j server not storing in current directory it is storing in ..\OAF\jdevhome\jdev\system9.0.3.5.1447\oc4j-config , that I could not figured it out.
Now after giving the absolute path it is generating fine.
Thank you for your help George.
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Background In several of the companies I have worked for, I noticed that corporate reporting is off loaded from the production database and done mainly on a clone database which needs to be kept up to date daily by various means, be it a logical…
Create a Windows 10 custom Image with custom task bar and custom start menu using XML for deployment.
This video shows how to copy a database user from one database to another user DBMS_METADATA.  It also shows how to copy a user's permissions and discusses password hash differences between Oracle 10g and 11g.
This video shows how to recover a database from a user managed backup
Suggested Courses

807 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question