aspose file tools*
The moose likes XML and Related Technologies and the fly likes How i can use JAXB to convert a ResultSet to XML document?	Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » XML and Related Technologies
Bookmark "How i can use JAXB to convert a ResultSet to XML document?	" Watch "How i can use JAXB to convert a ResultSet to XML document?	" New topic
Author

How i can use JAXB to convert a ResultSet to XML document?

raminaa niilian
Ranch Hand

Joined: Jul 14, 2005
Posts: 551
Hi
Thank you for reading my post.
I need to conver a ResultSet to XML document.
i know that JAXB can do this for me , but it needs an XML schema ? for doing this
am i correct ?

in case that it need an XML schema , where i can find that XML schema for resultset ?
Is there an easier framework to use to make this Object<>XML job ?

Thanks
William Brogden
Author and all-around good cowpoke
Rancher

Joined: Mar 22, 2000
Posts: 12821
    
    5
If you know what you want the XML for a single result to look like, just write it with print statements.
No need to get complicated, faster, under your direct control, whats not to like?
Bill
raminaa niilian
Ranch Hand

Joined: Jul 14, 2005
Posts: 551
Hi
I need to send this XML in a web service to a none java client.
do you have other suggestion for transfering a result set to a none java client ?
I think best way is to serialize it to an xml document anf then transform that document to client side.
Client must recive XML data , nothing else.
Masoud Kalali
Author
Ranch Hand

Joined: Jul 08, 2004
Posts: 531

Serializing a complete resultset to XML will return a very big and hard to process XML file.
in case that you need the Data that a ResultSet carry , then try to extract the data and create an xml from your Data itself , not from ResultSet.

if you are still looking to serialize your ResultSet , take a look at
http://xstream.codehaus.org/
it is very easy to use framework.


Masoud Kalali
Software Engineer - My Weblog - GlassFish Security
deepak reads
Greenhorn

Joined: Nov 01, 2004
Posts: 13
has anyone tried getting back resultSet back from the xml.we are able to convert the resultset to xml using xstream but getting errors when parsing the xml back to ResultSet
William Brogden
Author and all-around good cowpoke
Rancher

Joined: Mar 22, 2000
Posts: 12821
    
    5
ResultSet is an interface.

Classes implementing ResultSet would be expected to have some sort of relationship to the underlying JDBC implementation.

Exactly why do you think you need a ResultSet?

Bill
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How i can use JAXB to convert a ResultSet to XML document?