title: in JAVA - How to insert json data into a nested json property?
body: <p>I have this code i have on my java server:</p>
  
  <pre><code>JSONArray resultJson = new JSONArray();
  try{
      ConnectToDB();
      stmt = conn.prepareStatement(query);
      m_ResultSet = stmt.executeQuery();
      resultJson = FromDBToJSON.toJSON(m_ResultSet);
      }
  </code></pre>
  
  <p>I am getting this result:</p>
  
  <pre><code>id: 1,
  dest_country: "England",
  fname: "Duncan",
  lname: "Hurley",
  address: "xyz"
  },
  {
  id: 2,
  dest_country: "England",
  fname: "Duncan",
  lname: "Hurley",
  address: "xyz"
  },
  {
  id: 3,
  dest_country: "Israel",
  fname: "Duncan",
  lname: "Hurley",
  address: "xyz"
  },
  {
  id: 4,
  dest_country: "USA",
  fname: "Duncan",
  lname: "Hurley",
  address: "xyz"
  },
  </code></pre>
  
  <p>I need to put all the user data (which is fname, lname, address) into a nested property, for exanple like this:</p>
  
  <pre><code>{
      id : 2,
      dest_country: "England",
      user: {
          fname: "Duncan",
          lname: "Hurley",
          address: "xyz"
      }
  }
  </code></pre>
  
  <p>how can this be achieved?</p>
  
  <p>Thank you!</p>