• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • paul wheaton
  • Ron McLeod
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Liutauras Vilda
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Carey Brown
  • Piet Souris
Bartenders:

huge recordset problem

 
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
When I use
ResultSet rs = stmt.executeQuery("Select * from ..."); I retrieve a ResultSet which contains many records (say 10000). Subsequently I loop on the ResultSet and load a Vector with data extract from ResultSet. In particular i nested two loop like in example below:
Vector result = new Vector();
ResultSetMetaData rsm = rs.getMetaData();
while(rs.next){
result.add(rs.getString(1));
...
for(j=x;j<rsm.getColumnCount();j++){>
if (rsm.getColumnType.equals("CHAR")){
.....
result.add(rs.getString(j));
}
else{
.....
result.add(rs.getBigDecimal(j));
}
}
}
The performance of this loop is very low and in many case the application crash.
My question is, how can I handle these kinds of huge resultsets and how can improve the application performance.
Note:
I have noticed that my DBMS (Oracle 8) execute the query in few millisecond.
Regards,
Antonio S.
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic