title: Update 1000+ Records using JDBC -
body: <blockquote>
  <p>Hi, I'm trying to update <strong>1000+ records</strong> using <em><strong>Java Database
  Connection (JDBC)</strong></em> but my solution doesn't work:<br/></p>
  </blockquote>
  <pre><code>Connection c = null;
  Statement statement = null;
  String color = &quot;init&quot;;
  try{
  String builder= &quot;SELECT COLOR,SHAPE FROM TBL_SHAPES&quot;; // this line of code will fetch 1000+ records of data from the database.
  c = getConnection();
  statement = c.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE, ResultSet.CONCUR_UPDATABLE);
  ResultSet rs = statement.executeQuery(builder.toString());
  if(rs.getFetchSize() &gt; 0) {
  while(rs.next()) {
      color = rs.getString(&quot;COLOR&quot;);
          if(!color.equalsIgnoreCase(&quot;init&quot;)) {//this code will check if the color is not &quot;init&quot; 
             switch(color) {
                case &quot;green&quot;:
                 rs.updateString(&quot;SHAPE&quot;, &quot;TRIANGLE&quot;);
                    break;
                  case &quot;orange&quot;:
                     rs.updateString(&quot;SHAPE&quot;, &quot;CIRCLE&quot;);
                    break;
                    case &quot;yellow&quot;:
                      rs.updateString(&quot;SHAPE&quot;, &quot;SQUARE&quot;);
                     break;
           }
         }
         rs.updateRow();
       }
      }}
  </code></pre>
  <blockquote>
  <p>Is there any efficient way to update 1000+ records? Thank you in
  advance!</p>
  </blockquote>