title: how to retrive payload data of restful web service in java using jersey and json
body: <p>I am doing restful webservice in java using Jersey,Json and mysql .
  By using POST method of chrome's advanced rest client i am sending json data through payload.
  Now i want to read that json data in my java file how to do this ?</p>
  
  <p>My code :--</p>
  
  <pre><code>public ArrayList&lt;FeedObjects&gt; GetStudent(Connection connection) throws Exception
  {
      ArrayList&lt;FeedObjects&gt; feedStudent = new ArrayList&lt;FeedObjects&gt;();
      try
      {
          //String uname = request.getParameter("uname");
          //PreparedStatement ps = connection.prepareStatement("SELECT book_id,bookname,price,author FROM book ORDER BY book_id DESC");
  
          PreparedStatement ps1 = connection.prepareStatement("SELECT * FROM student,CollegeMaster where student.c_id=1 AND CollegeMaster.c_id = 1");
          //ps.setString(1,uname);
          //ResultSet rs = ps.executeQuery();
          ResultSet rs1 = ps1.executeQuery();
          while(rs1.next())
          {
              FeedObjects feedObject = new FeedObjects();
  
              feedObject.setS_id(rs1.getString("s_id"));
              feedObject.setS_name(rs1.getString("s_name"));
              feedObject.setS_address(rs1.getString("s_address"));
              feedObject.setS_contact(rs1.getString("s_contact"));
              feedObject.setS_class(rs1.getString("s_class"));
              feedObject.setC_name(rs1.getString("c_name"));
              feedObject.setC_address(rs1.getString("c_address"));
              feedStudent.add(feedObject);
          }
          return feedStudent;
      }
      catch(Exception e)
      {
          throw e;
      }
  }
  </code></pre>
  
  <p>i have {"c_id":"1"} from advanced rest client's payload (payload of POST method) which is in json.
  Now I want to read this c_id from my java program and then,
  As from above code .. I want to add that c_id=1 into query written below.
  PreparedStatement ps1 = connection.prepareStatement("SELECT * FROM student,CollegeMaster where student.c_id=1 AND CollegeMaster.c_id = 1");</p>