E
Esko
A relatively simple question, I'd like to get some feedback from other
developers. Let's say I have the following a table with a list of countries,
which doesn't change (at least not very often). Now, in my table, I have the
list ordered alphabetically, however when I want to then query this table
from my application and display it on a jsp I want "USA" to list first,
followed by "Canada", then the rest of the countries. What I am doing at the
moment is grabbing the list from the db via JDBC into a Collection, then
removing both those entries, and then reinserting using List.add(pos,obj) at
positions 0 and 1, respectively. Should I be doing this in my app, or should
I do it at the database level? The options I have are to drop that table and
recreate it with the appropriate ordering, or change my select statement to
somehow put those two countries first (I'm not sure how to do that).
Any insight?
Thanks,
-Esko
developers. Let's say I have the following a table with a list of countries,
which doesn't change (at least not very often). Now, in my table, I have the
list ordered alphabetically, however when I want to then query this table
from my application and display it on a jsp I want "USA" to list first,
followed by "Canada", then the rest of the countries. What I am doing at the
moment is grabbing the list from the db via JDBC into a Collection, then
removing both those entries, and then reinserting using List.add(pos,obj) at
positions 0 and 1, respectively. Should I be doing this in my app, or should
I do it at the database level? The options I have are to drop that table and
recreate it with the appropriate ordering, or change my select statement to
somehow put those two countries first (I'm not sure how to do that).
Any insight?
Thanks,
-Esko