• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Big ResultSet

 
navi kumar
Ranch Hand
Posts: 47
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,

I have a sql that retrieves more than 50k rows. I need to display these values in the selectbox(dropdown) on my JSP screen.

When I do so, I get outOFmemeory Exception and operation timed out.

One solution I found was to use Statement.setMaxRows(int max).

But, does this restrict the rows to be displayed or fetches only the number of rows set(say for example 50). If yes, how to retrieve the other rows into the drop down?

Any other suitable suggestions?

Regards
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 35279
384
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Navi,
setMaxRows() limits the total number of rows returned. setFetchSize() returns them in smaller batches. This helps avoid OutOfMemory errors in the driver. You still need to take care not to introduce one in your code.

From a usability perspective, do you have all 50,000 rows in the same drop down? This seems like it would be hard to find the relevant item in.
 
navi kumar
Ranch Hand
Posts: 47
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
yes Jeanne,

It would be hard for the users to dive in and search in the drop down of 50000 values.
But, basically, when the user screen is shown, this values should be in drop down. Later they are supposed to select an id, which when done will be submitted to the server and only relavant(in sense, the values where id="selected") will be dropped in the drop down.

And thanks for you reply.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic