This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
The end-user sees a JTable gui with some data/elements in it (title, name�). He can have them ordered in any way he wants, when he clicks save and later comes back to the table he should see the order he previously saved.
For some reason, when he clicks save the first time � the data is saved in the same ordered he requested, however the second time he clicks save, the order is reversed.
I realized the elements are saved reversed in the database.
You haven't shown the SQL that is relevant to your question, namely the SELECT statement that you are complaining about. If you want your data ordered in a certain sequence then you have to arrange that by providing an ORDER BY clause when you select the data. So what does your ORDER BY clause look like?
Joined: Sep 10, 2004
There is no "ORDER BY" as the end user determines the order.
The select is straight forward: SELECT * FROM guestTable WHERE groupId=?
As a few of the posters have said. If order is important you need to be explicit in SQL. Order should be thought of as undefined by default. For example in Sybase ASE your order can be changed when the dba decides to implement a clustered index on your table (or remove it).