Is there any pattern to speed-up DB operations
Hi,
I am using JTable to represent the data in DB. Fething all the rows in tier-2(EJB) and sending result set as vector to Tier-1and rendering to JTable.
If there are large number of rows in db, user has to wait for some time. Is there any way (PATTERN ) that speeds-up the process like what AJAX does. Fetch 1000 rows and show in JTable and continue the process until all rows are retrieved so that user will feel some happy than seeing freezed GUI. I need pattern name and any implementation procedure with respect to Java of it.
Any help is appreciated.
# 2
Users will not be able to handle working with 1000 rows of data (just trying to scroll through 1000 rows will cause thier eyeballs to explode). I suggest you add one or more filters to limit the number of rows displayed to about 50 or so. Example: If you are showing peoples names in a list, add a textbox that the user can enter a part of a last name. Then filter on that Example: to get only the lastNames starting with B, enter 'B' in the textfield, Then add a 'where' cause to your sql statement as in:"select * from person where lastName like 'B%'.
Now only a subset of records is returned. You may add additional filters such as a minimum age range (people over 33). Produce an error if they leave the first filter blank, but allow the second filter to be blank (that means do not apply an age filter to the sql statement). Another possiblity: if more than say 200 records exists for a fitler search, tell them to more narrowly filter their request, and dont display all the data.
Also, only display columns of data that means something to the end user. Dont display all the fields found in the database. The less columns you fetch from the database, the less data displayed and the faster the search. Remember the JSP page is to display just the information to do his job and not infomration he does not need.
Also, I assume your using connection pooling to speed up the search.