title: update current date and time to db using sql from Java code
body: <p>i have a table "queue_in_progress" whose structure is like the following : </p>
  
  <p><img src="https://i.stack.imgur.com/cRMGd.png" alt="enter image description here"></p>
  
  <p>I want to update the DATE_TIME_TOKEN_TAKEN  , CE_PK , Service_status  of the table . For this , I have the following code : </p>
  
  <pre><code>    String sqlQuery = "UPDATE queue_in_progress\n"  +
                   "SET CE_PK="+ce_pk+" ,SERVICE_STATUS=1 \n"  +
                   "WHERE CATEGORY_PK="+Category_PK+" AND TOKEN_NO="+ Token_PK+" "
                      + " AND SERVICE_COUNTER="+service_counter+" AND SERVICE_CENTER_PK="+service_center+" ;";
  
  java.util.Date utilDate = new Date();  // Convert it to java.sql.Date
  java.sql.Date date = new java.sql.Date(utilDate.getTime());
  
  PreparedStatement stmt = con.prepareStatement(sqlQuery);
                      stmt.setDate(1, date);
                      success = stmt.executeUpdate();
  
   But the success flag is returning -1 and the table is not updated . What is the problem ? What can I do to fix this problem ? 
  </code></pre>