java - Better to use TreeMap or order by? -


What will be a better programming practice?

Is the client better to use commands in SQL or results for things like dropdown in drop vs. hasp?

If you are thinking about performance, then better results in the end of the database Is solved, especially when the columns you sorted are indexed.

The performance difference for small data sets may not be significant, but I think that the order of the SQL command will be a simple approach in most cases.

Anyway you still have to use LinkedHashMap instead of plain Hasham if you should store previously pre-sorted data before using it in Maps. Since LinkedHashMap will place the data in an inclusion order, the hashmap will not be there.

If you want the data to be automatically sorted because it is placed in the map, then you will need a treemark or other sorted map implementation.


Comments

Popular posts from this blog

oracle - The fastest way to check if some records in a database table? -

php - multilevel menu with multilevel array -

jQuery UI: Datepicker month format -