title: Updating multiple rows of single table
body: <p>I need to update every row of a table having more then 60k rows.
  Currently I'm doing it like this:</p>
  <pre class="lang-java prettyprint-override"><code>public void updateRank(Map&lt;Integer, Double&gt; map) {
      Iterator&lt;Map.Entry&lt;Integer, Double&gt;&gt; it = map.entrySet().iterator();
      while (it.hasNext()) {
          Map.Entry&lt;Integer, Double&gt; pairs = (Map.Entry&lt;Integer, Double&gt;) it.next();
          String query = &quot;update profile set rank = &quot; + pairs.getValue()
                  + &quot; where profileId = &quot; + pairs.getKey();
          DBUtil.update(query);
          it.remove();
      }
  }
  </code></pre>
  <p>This method alone took around 20+ mins to complete, hitting the database for each row(60k) is what i think the reason here.(though i'm using dbcp for connecton pooling, with 50 maximum active connections)</p>
  <p>It'd be great if i'd  be able to update rows with single database hit. Is that Possible ? How ?</p>
  <p>Or any other way to improve timing here ?</p>