Results 1 to 4 of 4

Thread: Unable to convert a JDBC Result Set into Xml File

  1. #1
    Join Date
    Apr 2009
    Posts
    68

    Unable to convert a JDBC Result Set into Xml File

    Any ideas on how to convert a ResultSet to XML in Java? I have a problem to export my SQL query is resulty into an XML file. I need some java code to store my resultset in a xml file. And next the buyer or the user will select the books depends on the price ,so I have to store all the books in a xml and search according to the price.

  2. #2
    Join Date
    Apr 2008
    Posts
    34

    Re: Unable to convert a JDBC Result Set into Xml File

    It looks like you are putting freely typed-in comments from end-users into an xml document. Simply convert your data into xml string. Write the string to the response stream, and set the content-type header as text/xml, and content-length header as length of string. The problem with this is that the user may enter characters in his text that have special meaning to xml and will have to be escaped correctly.

  3. #3
    Join Date
    Mar 2008
    Posts
    232

    Re: Unable to convert a JDBC Result Set into Xml File

    XML has become the common format for passing data between components residing on different platforms. As far as searching goes I'm not quite sure what your actual requirements are here--how the data is stored shouldn't really matter to the searching, unless they're searching XML by just looking at the file. With the move to XML-based services, developers often find themselves converting various data structures to and from XML. Arguably, the most prevalent form of persisting data is in relational databases.

  4. #4
    Join Date
    Feb 2006
    Posts
    126

    Re: Unable to convert a JDBC Result Set into Xml File

    The Hibernate Framework includes functionality for producing XML-based data derived from relational data. There is a simple toXML() method which handles this. The JSP page is for displaying data ONLY and submitting back to a servlet. Put all your business logic in the servlet. Putting business logic in JSP is considered bad coding and will cause you many hours of headache trying to debug it.

Similar Threads

  1. Replies: 4
    Last Post: 24-04-2012, 07:53 AM
  2. Unable to convert pdf file to epub for Mac.
    By AjaxDEV in forum Operating Systems
    Replies: 5
    Last Post: 23-11-2011, 01:42 AM
  3. Unable to convert the .mkv file without subtitle
    By Karunashankar in forum Windows Software
    Replies: 6
    Last Post: 31-03-2011, 10:36 AM
  4. Unable to convert any video file to avs file
    By Hamlet in forum Windows Software
    Replies: 5
    Last Post: 08-03-2010, 11:30 AM
  5. Insert sql query result in a file
    By TechGate in forum Software Development
    Replies: 5
    Last Post: 21-01-2010, 11:52 AM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,714,134,497.90984 seconds with 17 queries