I need to display the result of a select from database like a report on web page. also I have to apply functionality such as filter and sorting.
what is the best way to do this?
do I have to reconstruct the select sql statement everytime and do retireveing from database everytime.
in MS ADO,there is filter and sort in recordset,what about in JAVA world?
-
apply filter and sort to result (5 messages)
- Posted by: zhang zhang
- Posted on: April 23 2005 08:57 EDT
Threaded Messages (5)
- apply filter and sort to result by Rich Hill on April 23 2005 10:37 EDT
- apply filter and sort to result by zhang zhang on April 23 2005 11:13 EDT
-
apply filter and sort to result by Air tome on April 23 2005 02:41 EDT
-
apply filter and sort to result by zhang zhang on April 24 2005 08:15 EDT
- apply filter and sort to result by Rich Hill on April 26 2005 10:24 EDT
-
apply filter and sort to result by zhang zhang on April 24 2005 08:15 EDT
-
apply filter and sort to result by Air tome on April 23 2005 02:41 EDT
- apply filter and sort to result by zhang zhang on April 23 2005 11:13 EDT
-
apply filter and sort to result[ Go to top ]
- Posted by: Rich Hill
- Posted on: April 23 2005 10:37 EDT
- in response to zhang zhang
It would be better to modify the SQL and let the DB server do the job for you. If you are using Hibernate, there are sort and filter methods that can be applied directly to the query object. Otherwise, I would look at the jakarta Commons CollectionUtils package for sorting the results. -
apply filter and sort to result[ Go to top ]
- Posted by: zhang zhang
- Posted on: April 23 2005 11:13 EDT
- in response to Rich Hill
what I like is get the result from database and cache the result as an object,then I can munipulate the result such as filtering and sorting.
any idea? -
apply filter and sort to result[ Go to top ]
- Posted by: Air tome
- Posted on: April 23 2005 14:41 EDT
- in response to zhang zhang
I think it depends on, how much and how long data to be cached. If you application use small amount of data for a short period, then you can cache for filtering and sorting.
Otherwise you should do sorting and filter at database. -
apply filter and sort to result[ Go to top ]
- Posted by: zhang zhang
- Posted on: April 24 2005 08:15 EDT
- in response to Air tome
Thanks,
How can I do for small amount and short period?
why it's not apply for big? -
apply filter and sort to result[ Go to top ]
- Posted by: Rich Hill
- Posted on: April 26 2005 10:24 EDT
- in response to zhang zhang
Look at using EM Cache.
You don't want to do it on large amounts of data because you'll be eating up memory very quickly, also the sorting and filtering operations will become expensive.