Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Devaka Cooray
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Knute Snortum
  • Bear Bibeault
Saloon Keepers:
  • Ron McLeod
  • Tim Moores
  • Stephan van Hulst
  • Piet Souris
  • Ganesh Patekar
Bartenders:
  • Frits Walraven
  • Carey Brown
  • Tim Holloway

Java with XML -- help urgent

 
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I need to code an application with XML wherein data comes from a database say MSAccess. I want to have this in my Java application wherein it operates on XML data. I am constrained to use only Java as I know only programming in Java and of course XML. Please tell me how to go about this. A sample program would be of great help. Please suggest me some related links.
Thnx in advance,
Vids.
 
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Vids,
Are You planning to have a Web based application or its gonna be a standalone application ? When you say that data is coming from MS-Access, would you be building a XML document off that data (RowSet) and then pass this XML document to a Java program ?will this Java program be on the same machine or a remote machine ?

Assuming that you will be building the XML from the data retrieved from Access Db; You will need to use DOM parser. DOM parsers allow you to modify data in a XML document (or Create a XMl document.)
Hope this is helpful. Let me know if you would like to share ur requirements.
Best Regards.

------------------
_SvR_
[This message has been edited by Sameer Rao (edited October 30, 2000).]
 
Vids
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi SVR,
It will be a standalone application. Yes, I would be building XML document using the data from MSAccess and then pass this XML document to Java program. All the programs will be on the same machine and no question of remaote machine.
So keeping these requirements, can U just gimme an idea how to proceed or a small piece of code wherein XML document is built in Java program and data comes from D/b.
Thanks,
Vids
 
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi vids,
i hope that u want a xml standalone application.
for that u need and xmlconverter which converts database records
into corresponding xml documents.then u do all the process on the xml documents.writing that xmlconverter is very easy.
use JDBC fetch the records and write the recordvalues within the tags.
now u use parsers to parse those xml documents.and now u can do all sort of stuff like rendering etc..
i hope this is sufficient to start.
bye
 
Sameer Rao
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi vids,
Heres a represntation I thought of. This may not be the Best or the standard representation. I am sure there will be some standard representation DTD for RecordSet. If you come across one do let me know off it.
Hope this helps,
_SvR_
<ResultSetXSL>
<MetaData >
<Database name="Oracle8i" version="8.1.6" />
<ColumnInfo numberOfColumns="x" >
<Column Name="Employee_Name" dataType="String"/>
<Column Name="Employee_Age" dataType="int"/>
<Column Name="Employee_Address" dataType="String"/>
</ColumnInfo>
</MetaData>
<RowData>
<Row id="1" >
<Column name="Employee_Name" value="Sameer" dataType="String"/>
<Column name="Employee_Age" value="24" dataType="int"/>
<Column name="Employee_Address" value=" J4" dataType="String"/>
</Row>
<Row id="2" >
<Column name="Employee_Name" value=" Sameer" dataType="String"/>
<Column name="Employee_Age" value="24" dataType="int"/>
<Column name="Employee_Address" value=" J4" dataType="String"/>
</Row>
<Row id="3" >
<Column name="Employee_Name" value=" Sameer" dataType="String"/>
<Column name="Employee_Age" value="24" dataType="int"/>
<Column name="Employee_Address" value=" J4" dataType="String"/>
</Row>
</RowData>
</ResultSetXML>
------------------
_SvR_
[This message has been edited by Sameer Rao (edited November 15, 2000).]
 
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi vids
i think the xerces parser would be of great help to u.
u can find lots of topic on xerces in the net.
and if u have any queries about xml related things ...just visit www.w3schools.com or www.w3c.org.

Originally posted by Vids:
I need to code an application with XML wherein data comes from a database say MSAccess. I want to have this in my Java application wherein it operates on XML data. I am constrained to use only Java as I know only programming in Java and of course XML. Please tell me how to go about this. A sample program would be of great help. Please suggest me some related links.
Thnx in advance,
Vids.


 
Ranch Hand
Posts: 5093
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Xerces (and Xalan) home: http://xml.apache.org/
 
Ranch Hand
Posts: 1874
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello , everybody. This is Shailesh here. New moderator of this forum. Welcome everyone in this cool place.
[b]I would start my mission right now. As you know that javaranch has got official naming policy. Every user has to register with proper first & last name.
Vids please reregister yourself with proper first & last name & help maintain the decorum of the forum.
YOUR FRIENDLEY BARTENDER
SHAILESH.
 
Consider Paul's rocket mass heater.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!