title: Jersey webservice returning a null JSON
body: <p>I want to get the data of a database table to the client end. I'm sending the data via a JSON. When I print the output result in the client end it gives the following result.</p>
  
  <pre><code>{"pricing":null}
  </code></pre>
  
  <p>When I print return statement in the server end, it outputs the following</p>
  
  <pre><code>[Connection.Pricing@3d5bae2]
  </code></pre>
  
  <p>There are no errors. What have I done wrong?</p>
  
  <p>Here is my Client Side Code</p>
  
  <pre><code>public String loadTable(String tablename) throws ClientProtocolException, IOException {
      pathParams.add("tablename", tablename);
      ClientResponse response = service.path("access").path("loadtable").queryParams(pathParams).type(MediaType.APPLICATION_JSON).get(ClientResponse.class);
      String responseString = response.getEntity(String.class);
      return responseString;
  </code></pre>
  
  <p>This is my Server End</p>
  
  <pre><code>@Path("/loadtable")
  @GET
  @Produces(MediaType.APPLICATION_JSON) 
  public List&lt;Pricing&gt; loadTable(@QueryParam("tablename") String tablename) throws Exception {
      List&lt;Pricing&gt; pricing = new ArrayList&lt;Pricing&gt;();
      try {
          query = c.prepareStatement("select * from " + tablename);
          ResultSet ets_rs = query.executeQuery();
  
          while (ets_rs.next()) {
          pricing.add(new Pricing(ets_rs.getString(1), ets_rs.getString(2),  ets_rs.getString(3), ets_rs.getString(4), ets_rs.getString(5), ets_rs.getString(6)));
          }
          query.close();
      } catch (Exception e) {
          e.printStackTrace();
      } finally {
          if (c != null) {
              c.close();
          }
      }
      return pricing;
  </code></pre>
  
  <p>Here is my POJO class in the server end</p>
  
  <pre><code>@XmlRootElement
  class Pricing {
  
  String category;
  String lower_limit;
  String class_no;
  String value;
  String employee;
  String upper_limit;
  
  public Pricing() {
  }
  
  
  
  Pricing(String a, String b, String c, String d, String e, String f) {
      category = a;
      lower_limit = b;
      upper_limit = c;
      class_no = d;
      value = e;
      employee = f;
  }
  //getters
  }
  </code></pre>