title: Java Json Object to Json Array Conversion
body: <p>Im new to java.I am trying to get data from stored procedure and convert it into json array. But Im facing some problems with my code.</p>
  <pre><code>           /*** Get data from stored procedure ***/
             Map&lt;String, Object&gt; out =  simpleJdbcCall.execute(in);
             /*** Convert to JSONObjects ***/
             JSONObject jsonRes = new JSONObject();
             jsonRes.put(&quot;body&quot;, out.get(&quot;#result-set-1&quot;));
             System.out.println(out.get(&quot;#result-set-1&quot;));
  
  output :
  
            [{user_id=484, user_name=&quot;abc&quot;, email=null, contact_no=123456789}, 
             {user_id=485, user_name=xyz, email=null, contact_no=235612354}]
  
  Expected output :
  
            {
              &quot;body&quot;:
                  &quot;Data&quot;:{
                          {
                           {user_id=484, user_name=&quot;abc&quot;, email=null, contact_no=123456789},
                           {user_id=485, user_name=xyz, email=null, contact_no=235612354}
                          }
                         }
             }   
  </code></pre>