ramadevimandala
asked on
need to convert CLOB sxml data to xml files
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
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>
ASKER
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("IOExce ption " + e.getMessage());
}
please tell me if I am wrong
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
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("IOExce
}
please tell me if I am wrong
Is there any exceptions?
ASKER
No not getting any execption
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Hmmm, my code was generating XML but OC4j server not storing in current directory it is storing in ..\OAF\jdevhome\jdev\syste m9.0.3.5.1 447\oc4j-c onfig , that I could not figured it out.
Now after giving the absolute path it is generating fine.
Thank you for your help George.
Now after giving the absolute path it is generating fine.
Thank you for your help George.
Use an output stream and write it to file.
Regards,
gibu_george