title: Auto generate link for newly registered user
body: <p>I want to make auto generated link for newly created </p>
  
  <p>user that mywebapp will send to the user's email. When </p>
  
  <p>the user clicks the link i should update the user as </p>
  
  <p>'activated'.</p>
  
  <p>So I've got some questions and I want to understand if </p>
  
  <p>from  what I've read so far my logic is right.</p>
  
  <ol>
  <li>user fills in a form and press enter</li>
  </ol>
  
  <p>2.My web service process the data and create an account...... </p>
  
  <p>So is here the part where i hash the typed password with some unique salt and store it in the database. </p>
  
  <p>so i will have a table like</p>
  
  <pre><code>user_ID   username         password                 active 
  
  1           taniamm20     12346645556665566666       0
  </code></pre>
  
  <p>can i use this hashed password in the verification link for example</p>
  
  <pre><code>http://localhost:9092/localbusscat/services/localbusscat/UpdateDB?choID=12346645556665566666       
  </code></pre>
  
  <p>Is it a good practice ? </p>
  
  <p>Or at this point i should not save the password of the user and just save user_id and generate long unique key using java.UUIID for that user and save it in the table and use this unique key for verification.</p>
  
  <p>I think my UpdateDBService should look likethis </p>
  
  <pre><code>public  String  UpdateDB(int choID ) throws ClassNotFoundException 
          {
  
              String strDelReturn = "UPDATE_FAIL";
  
              Class.forName("org.postgresql.Driver");
              try 
              {
                  conn = DriverManager.getConnection("....");
              }
  
              catch (SQLException ex) 
              {
  
                  ex.printStackTrace();
              }
  
  
              PreparedStatement pstmt = null;
              String selectQuery = "update user_table set active=active+1 WHERE password="+ choID ;
  
              try {
  
                  pstmt = conn.prepareStatement(selectQuery);
                  int rowss = pstmt.executeUpdate();
                  if (rowss != 0) 
                      strDelReturn = "UPDATE_OK";
  
              } 
              catch (Exception ex) 
              {
  
              }
              return strDelReturn;
  }
  </code></pre>