Advice how to sort data from database
I want to create a class, where I want to take a number of rows out of the database, which among others include what day that assignment should be done.
I then want to sort the data after what day it is. For instance if it's currently Monday, the sorting should start with the rows where it says Monday and so on. The next day all the rows including monday goes in the back of the sorting. If it's Friday it starts with all data including Friday, then Saturday and so on. I assume you get my point?
At last my gui components(a number of JLabels) should display this sorting accordingly to what day the program is opened.
My problem is that I can't really seem to get started. What is the easiest way to approach this project? And is it more complicated than I initially assumed?
Re: Advice how to sort data from database
Sort the data on the database side using and ORDER BY clause, use the appropriate Collections.sort() method (the Date class implements Comparable already), or write your own sorting algorithm.