Sort a ResultSet based on data in one of the ResultSet Columns
Dar Var
Ranch Hand
Joined: Oct 12, 2004
Posts: 74
posted
0
Hi,
Does anyone know how the sort a ResultSet based on data in one of the ResultSet Columns?
NOTE: I do not want to run a modified query to do the sorting.
The ResultSet may contain a text column. I need to resort the ResultSet alphabetically based on this text column.
The resulting ResultSet should return for example: Row Text Column 1 aaaa 2 bbbb 3 cccc etc...
D Rog
Ranch Hand
Joined: Feb 07, 2004
Posts: 471
posted
0
Which database? I'd suggest to use temporary sorted array to insert all records from ResultSet in sorted order. This approach can be more portable. However if you use paganation it can bring incomplete data.
Duplicate post. And the answer is you have to modify the query. I'll post a longer answer in your original post on why. [ July 19, 2007: Message edited by: Scott Selikoff ]