• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

I hate to use a bad word here

 
Mark Spritzler
ranger
Sheriff
Posts: 17278
6
IntelliJ IDE Mac Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Pardon my blasphemous words, but in vb.net they have their new DataSet which is XML, and they have a class, I can't think of it's name off hand, but You can pass DataSets/ResultSets to this class and it will create XML for you following a DTD. You can then pass it to a parser that will combine it with XSL to make a pretty or should I say as pretty as a web page can be html document. The coding is very minimal.
My question: Is there an equivalent class in Java that can take a ResultSet from JDBC and convert it to XML, then pass the XML and the XSL sheet to a parser to automagically make HTML?
Thanks
Mark
 
Scott Bain
Ranch Hand
Posts: 46
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It would suprise me if there wasn't but I don't have a specific tool in mind.
However, Castor does have a utility for making a set of databean classes from a schema (and if all you have is a DTD, the tool includes a DTD - Schema converter).
www.castor.org
 
Mark Spritzler
ranger
Sheriff
Posts: 17278
6
IntelliJ IDE Mac Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks,
from my brief look at it. It looks like it handles the first part of translating the ResultSet into XML.
Mark
 
Scott Bain
Ranch Hand
Posts: 46
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Right. The general idea behand castor is one of "data-binding" -- that is, the automatic marshalling and unmarshalling of an XML structure into (and back out of) a set of objects.
You create objects (databeans), set their state, then marshall these into an XML structure (you can allow Castor to create this as it sees fit, or you can specify the nature of this structure with a mapping file, also in XML).
Subsequently, or alternatively, you un-marshall this XML structure into a series of objects with state.
You can start with the XML and have Castor make the objects, start with the objects and have Castor make the XML, or make both and create a mapping between them.
 
Doug Wang
Ranch Hand
Posts: 445
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I know some Database vendors have their own solution to this. But we are all looking forward to maturity of Sun's Data Access API and XML data-binding. (please refer to here)
[ January 16, 2002: Message edited by: Doug Wang ]
[ January 17, 2002: Message edited by: Doug Wang ]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic