title: How to change to display format of datetime received from a database in java
body: <p>I use this code to change util to sql, but the record happens with seconds and another value after</p>
  
  <pre><code>String insertAttendence = null;
  insertAttendence = "INSERT INTO ATTENDANCE (PRSN_ID,DATE,ARRIVAL,DEPART,DATE_ARRIVAL_FROM,DATE_DEPARTURE_TO) VALUES (?,?,?,?,?,?)";
  PreparedStatement psAttendence = null;
  
  psAttendence = dbConnection.prepareStatement(insertAttendence);
  psAttendence.setInt(1, personIdForGraphics.intValue());
  java.sql.Date sqlDate = new java.sql.Date(dates.get(i).getTime());               
  psAttendence.setDate(2, sqlDate);
  </code></pre>
  
  <p>In the database it is saved as follows 2019-07-26 11: 53: 18.0, I want it to be saved so 2019-07-26 11:53:18, how to change it?</p>