title: How can I insert an MD5("value" + CURRENT_TIMESTAMP) using prepared statements?
body: <p>I'm doing this:</p>
  
  <pre><code>String columns = "UserHash,EMail,Name,Gender,BirthYear,Birthday,MaritalStatus,UserID,ReferralUser,Likes";
  
  String sql = "INSERT INTO Users ("+ columns+") VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?);";
          byte[] bytesOfUserHash = user.getId().getBytes("UTF-8");
  
          MessageDigest md = MessageDigest.getInstance("MD5");
          byte[] userHash = md.digest(bytesOfUserHash);
  
          stmt  = con.prepareStatement(sql);
          stmt.setBytes(1,userHash);
          stmt.setString(2, user.getEmail());
          stmt.setString(3, user.getName());
          stmt.setInt(4, user.getGender().value());
          stmt.setString(5, birthday.split("-")[0]);
          stmt.setString(6, birthday);
          stmt.setInt(7, user.getRelationshipStatus().value());
          stmt.setString(8, user.getId());
          stmt.setString(9, referraluser);
          stmt.setString(10, likesjson);
          stmt.executeUpdate();
  </code></pre>
  
  <p>All values are being inserted except for <code>userHash</code>, so the query is succeeding.  What should I check?</p>
  
  <p>Also, note I'm just hashing the userid right now, but I would like to hash the userid + <code>CURRENT_TIMESTAMP</code>.</p>
  
  <p><strong>UPDATE:</strong>
  As a sanity check, I just tried tossing a string into the UserHash column as it is of type VARCHAR(45) and that's not working either.  Something is obviously amiss independent of the MD5 issue.</p>