title: Wait for the result of an database update before moving to next statement
body: <p>I want my servlet to wait for the result of a database update before moving to the next line.
  I have the following code snippet:</p>
  
  <pre><code>//wait for this to finish and get the status
  status=profiledao.updateProfile(profile);
  
  //then execute this statement
  httpresponse.getWriter().print(fileName);  
  </code></pre>
  
  <p>What is the best way to do this?</p>
  
  <p>Thanks.</p>