title: Passing query parameters rest client
body: <p>I have a rest service that retrieves data from a database and returns it to the client. i want the client that is invoking the service to pass parameters to use them in sql query <code>select</code> and display the server output in console. this is what i've managed to do: <br/></p>
  
  <pre><code>@GET
      @Path("Result")
      @Produces("application/json")
      public String getPerson(@QueryParam("nom") String nom, @QueryParam("prenom") String prenom) {
          ArrayList &lt;Persons&gt; persons= new ArrayList&lt;Persons&gt;();
          Persons person = new Persons();
  
          String query = "Select * from persons where nom=' " + nom + "' and prenom ='" + prenom + "'";
          System.out.println(query);
          bdcon = new BDConnexion();
          try {
              conn = BDConnexion.ConnecterBD();
              res = bdcon.getResultSet(query, conn);
              while (res.next()) {
                  person.setNom(res.getString(1));
                  person.setPrenom(res.getString(2));
                  persons.add(person);
              }
          } catch (SQLException ex) {
              Logger.getLogger(PersonService.class.getName()).log(Level.SEVERE, null, ex);
          }
          String json = new Gson().toJson(persons);
          return json;
      }
  </code></pre>
  
  <p>rest client:<br/></p>
  
  <pre><code>Client client = Client.create();
  WebResource webresource = client.resource("http://localhost:8080/PersonServ/rest/Persons/Result")
  .queryParam("nom", nom)
  .queryParam("prenom",prenom);
  ClientResponse response = webresource.accept("application/json").get(ClientResponse.class);
   if (response.getStatus() != 200) {
                 throw new RuntimeException("Failed : HTTP error code : "
                  + response.getStatus());
              }
              String output = response.getEntity(String.class);
  
              System.out.println("Output from Server .... \n");
              System.out.println(output);
  </code></pre>
  
  <p>I'm not getting any errors but the client class is not displaying any results. Can anyone help me?</p>