Performance issues with large ResultSet
- From: james <james.herrington@xxxxxxxxxxxxx>
- Date: Thu, 31 Jul 2008 02:59:09 -0700 (PDT)
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
.
- Follow-Ups:
- Re: Performance issues with large ResultSet
- From: Jean-Baptiste Nizet
- Re: Performance issues with large ResultSet
- Prev by Date: Re: Student Project Idea
- Next by Date: Re: Performance issues with large ResultSet
- Previous by thread: delete row from SortableTableModel
- Next by thread: Re: Performance issues with large ResultSet
- Index(es):
Relevant Pages
|