Home » Developer & Programmer » JDeveloper, Java & XML » unload the data from the Oracle database into xml, using java.
unload the data from the Oracle database into xml, using java. [message #664209] Fri, 07 July 2017 00:02 Go to next message
urself
Messages: 1
Registered: July 2017
Junior Member
I need to unload the data from the Oracle database into xml, using java.
I created a class to connect to the database using jdbc and there is a class for parsing in hml.
I have a difficulty in getting data from Oracle.
Do you have any documentation or templates on this?
Thank you.
Re: unload the data from the Oracle database into xml, using java. [message #664210 is a reply to message #664209] Fri, 07 July 2017 00:21 Go to previous message
Michel Cadot
Messages: 68716
Registered: March 2007
Location: Saint-Maur, France, https...
Senior Member
Account Moderator

Oracle has many tools to unload data to XML format.
For instance:
SQL> select dbms_xmlquery.getxml('select * from emp where rownum <= 3') from dual;
DBMS_XMLQUERY.GETXML('SELECT*FROMEMPWHEREROWNUM<=3')
--------------------------------------------------------------------------------------
<?xml version = '1.0'?>
<ROWSET>
   <ROW num="1">
      <EMPNO>7369</EMPNO>
      <ENAME>SMITH</ENAME>
      <JOB>CLERK</JOB>
      <MGR>7902</MGR>
      <HIREDATE>12/17/1980 0:0:0</HIREDATE>
      <SAL>800</SAL>
      <DEPTNO>20</DEPTNO>
   </ROW>
   <ROW num="2">
      <EMPNO>7499</EMPNO>
      <ENAME>ALLEN</ENAME>
      <JOB>SALESMAN</JOB>
      <MGR>7698</MGR>
      <HIREDATE>2/20/1981 0:0:0</HIREDATE>
      <SAL>1600</SAL>
      <COMM>300</COMM>
      <DEPTNO>30</DEPTNO>
   </ROW>
   <ROW num="3">
      <EMPNO>7521</EMPNO>
      <ENAME>WARD</ENAME>
      <JOB>SALESMAN</JOB>
      <MGR>7698</MGR>
      <HIREDATE>2/22/1981 0:0:0</HIREDATE>
      <SAL>1250</SAL>
      <COMM>500</COMM>
      <DEPTNO>30</DEPTNO>
   </ROW>
</ROWSET>
You have many examples in this (sub-)forum, just read the topics.
Oracle documentation is at docs.oracle.com as you didn't specify your version I can't give more specific document.

Previous Topic: XML file generation
Next Topic: data extraction from xmltype
Goto Forum:
  


Current Time: Thu Nov 21 07:07:27 CST 2024