wood burning stoves
The moose likes EJB and other Java EE Technologies and the fly likes Generating an xml file Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "Generating an xml file" Watch "Generating an xml file" New topic

Generating an xml file

ramjcp kris

Joined: Sep 05, 2005
Posts: 27
Hi All

I have a scenario in which i need to post the data in to database as well as i should be able to generate an xml file of this data which other interfaces would use.
can any one suggest me how i can write the data into xml file.
or please suggest me any useful links regarding this.

Thanks and waiting for reply with anticipation
Daniel Rhoades
Ranch Hand

Joined: Jun 30, 2004
Posts: 186
If your looking for a common way to write data to different types of datasources consider the DAO pattern. If your using EJB's then your server vendor might let you create a JNDI datasource mapping.

Drinking more tea is the key...
Eddy Lee Sin Ti
Ranch Hand

Joined: Oct 06, 2005
Posts: 135
Depends on your original data structure. If the source structure is in a result set, you might utilize the facility provided in javax.sql.rowset.WebRowSet to persist it to xml output.

If arbitrary structure such as POJO is used as source, then you can utilize JAXP API to do the serialization yourself.

And yes, using pattern such as DAO is useful in encapsulating the persistence strategy above so that you can change it without major impact.

SCJP, SCWCD, SCJWS, IBM 700,IBM 701, IBM 704, IBM 705, CA Clarity Technical<br /> <br /><a href="http://eddyleesinti.blogspot.com" target="_blank" rel="nofollow">http://eddyleesinti.blogspot.com</a>
I agree. Here's the link: http://aspose.com/file-tools
subject: Generating an xml file
It's not a secret anymore!