Hi, there!
For two days, I'm struggling with this problem:
I'm developing a Java application.
The program shows an ordered list of objects in a Swing JList. These objects are obtained with a SQL query (SELECT.....ORDER BY...) to a MySQL database.
The user can add an object. This object is inserted on database by mean of "INSERT INTO....".
After the object is inserted in database, the JList is cleared, and the same "SELECT....ORDER BY...." query is executed in order to populate the JList again.
But the added object appears at the end of the list, instead it appear in order.
After I restart the application, the added object appears in correct order.
I can't imagine why this happens.
I don't know SQL and MySQL very well. May be I'm omitting some statements for persists the changes in database... I don't know.
Can sombody help me with this problem?
Thank you, in advance.
For two days, I'm struggling with this problem:
I'm developing a Java application.
The program shows an ordered list of objects in a Swing JList. These objects are obtained with a SQL query (SELECT.....ORDER BY...) to a MySQL database.
The user can add an object. This object is inserted on database by mean of "INSERT INTO....".
After the object is inserted in database, the JList is cleared, and the same "SELECT....ORDER BY...." query is executed in order to populate the JList again.
But the added object appears at the end of the list, instead it appear in order.
After I restart the application, the added object appears in correct order.
I can't imagine why this happens.
I don't know SQL and MySQL very well. May be I'm omitting some statements for persists the changes in database... I don't know.
Can sombody help me with this problem?
Thank you, in advance.