This can easily be done in ibatis but I might suggest other ways of doing this.  In ibatis you could send the name of the column or even the number value in as a parameter.  Then just have a dynamic section on the end.

...
ORDER BY $sortByColumn$

Since your results will always be the same there is no need to remap the results.

IMHO I would just use a sorting option on the view side.  This could be implementing sorting on a JTable for a swing view or using _javascript_ to sort a table in html.  Both options allow for a faster UI with less DB queries.

My 2 cents.

Nathan


On 8/29/06, [EMAIL PROTECTED] < [EMAIL PROTECTED]> wrote:
Hi,
 
I have sortable columns in data list. When ever a column is sorted, I need to redisplay the data list sorting the selected column (toggle it if selected again).
I want to use one query by parameterizing the sorting column and its order (Asc or Dsc).
Please help me how to do it in iBATIS. We are using 2.1.7.
 
Regards,
Kiran

The information contained in this electronic message and any attachments to this message are intended for the exclusive use of the addressee(s) and may contain proprietary, confidential or privileged information. If you are not the intended recipient, you should not disseminate, distribute or copy this e-mail. Please notify the sender immediately and destroy all copies of this message and any attachments.

WARNING: Computer viruses can be transmitted via email. The recipient should check this email and any attachments for the presence of viruses. The company accepts no liability for any damage caused by any virus transmitted by this email.

www.wipro.com

Reply via email to