Why the modified record is written to the end of the list in the database?

There is a jsp page:
<c:forEach items="${usersFromServer}" var = "user">
the <tr>
 <td class=w3-round-small>${user.firstName}</td>
 <td>While no dates</td>
 <form method="post">
 <input type="hidden" name="id" value="${user.firstName}">
 <input type="hidden" name="name" value="${user.lastName}">
 <button type="submit" name="delete" value="${user.id}">Delete</button>

 <div class="center">
 <form method="post">
 <div class="row">
 <div class="col">
 <input type="text" id="first-name" name="first-name" naemclass="form-control" placeholder="First name">
 <div class="col">
 <input type="text" id="last-name" name="last-name" class="form-control" placeholder="Last name">
 <button type="submit" name="update" value="${user.id}">Edit</button>


Form with which a post request transmits the id of the row in the database and is redirected to the servlet
 protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
 String id = req.getParameter("delete");
 String update = req.getParameter("update");

 if (update != null){

 Integer id2 = Integer.valueOf(req.getParameter("update"));
 String firstName = req.getParameter("first-name");
 String lastName = req.getParameter("last-name");

 User user = new User(id2, firstName, lastName);
 if (id != null) {

The update method:
public class UserDaoJdbcImpl implements UsersDao{
 /* language=SQL */
 private final String UPDATE_USER =
 "UPDATE data_user SET firs_name=?, last_name=? WHERE id=?";
 public void update(User model) {
 PreparedStatement statement = connection.prepareStatement(UPDATE_USER);

 statement.setString(1, model.getFirstName());
 statement.setString(2, model.getLastName());
 statement.setInt(3, model.getId());

 int rows = statement.executeUpdate();
 System.out.printf("Updated %d rows", rows);
 catch (SQLException e)
 throw new IllegalStateException(e);

The edited record gets down list in the database.
March 20th 20 at 11:29
1 answer
March 20th 20 at 11:31
is written to the end of the list in the database
In the database there is no list, only the order of the rows.
So is recorded the timestamp for the sorted row.
Please tell me how to change this label to whatever he changed, the record is not endured to the end. - Vickie64 commented on March 20th 20 at 11:34
@Dario22using the DBMS administration tools to validate the structure of data. And set the desired sorting. - Brycen.Wehner68 commented on March 20th 20 at 11:37

Find more questions by tags JavaJSPJava servlets