title: JSONArray duplicate same result
body: <p>In my project, I used JSON to pass readed data from database to client side.In this code I put JSONObject in to JSONArray and pass to client side.</p>
  
  <p>This my code  for <code>JsonProcessing.java</code> servlet:     </p>
  
  <pre><code>JSONObject obj = new JSONObject();
  JSONArray objarr = new JSONArray();
  //read  from DB
  sql = "SELECT id, name FROM test";
  ResultSet rs = stmt.executeQuery(sql);
  while (rs.next()) {
      // Retrieve by column name
      int id = rs.getInt("id");
      String first = rs.getString("name");
      obj.put("name", first);
      obj.put("id", id);
      objarr.add(obj);
      System.out.print("\nobj: "+obj);
  }
  response.setContentType("application/json");
  response.setCharacterEncoding("UTF-8");
  
  PrintWriter out = response.getWriter();
  out.print(objarr);
  out.flush();
  </code></pre>
  
  <p>And this is my javascript code:</p>
  
  <pre><code>$.ajax({
  
      url : "/test/JsonProcessing",
      type : "get",
      data : {
          id : 30
      },
      success : function(info) {
  
          //alert(info.name);
          console.log(info);
          for (var i = 0; i &lt; info.length; i++) {
              alert(i + ":  " + info[i].name + "  " + info[i].id);
          }
  
          // data: return data from server
      },
      error : function() {
          alert('Faild');
          // if fails
      }
  
  });
  </code></pre>
  
  <p>I don't know why I take duplicate same result in alert ?</p>