Performance issues with large ResultSet



Hi all,

I'm experiencing some performance issues when processing ResultSet's
containing large amounts of data. The data is typically around 2,000
rows and although the database query only takes 0.9 seconds,
processing the results takes almost 30 seconds. All i'm doing is
iterating through the resultSet and placing the values into an xml
string. The code that does this is shown below.

while(rs.next()) {
// build XML
xmlResult += "<student studentID='" +
rs.getInt("StudentID") + "' firstName='" + rs.getString("FirstName") +
"' lastName='" + rs.getString("LastName") + "' gender='" +
rs.getString("Gender") +"' />";
} // End of loop

xmlResult is of type String, could this be causing performance issues?

I'm pretty new to java so this could just be a simple problem however
googling hasn't brought up much.

TIA
James
.



Relevant Pages

  • Re: Random file access -cont
    ... I use a text file format similar to CSV. ... for reasonably small amounts of data - a few thousand records - but it ... recommend XML unless the data volume is very small. ... .Net Compact Framework MVP ...
    (microsoft.public.dotnet.framework.compactframework)
  • Re: Will XML::Simple work with keys, strings, integers, and dates?
    ... I have only done a little XML processing in Perl, ... In all of the examples I have seen, the xml tags ... sub start_element ... is 'Earache My Eye ' of type string ...
    (comp.lang.perl.misc)
  • Re: XML and its uses
    ... The use of XML for data-exchange is largely a done deal, with vast ... amounts of software available, plentiful skills, relatively simple data ...
    (comp.text.xml)
  • Re: Custom .NET Class for Business Rule Fact
    ... > of type string. ... when I attempt to use an element in my XML ... > Can anyone advise what parameter type I should be using in my method? ... > An example of my XML document structure is below. ...
    (microsoft.public.biztalk.general)
  • Stored Proc Parameter
    ... I'm retrieving huge amounts of data from a local news service. ... The data is returned as XML and is processed by a stored proc, ... The only thing I can think of is processing the XML ...
    (microsoft.public.sqlserver.programming)