title: Retrieve data from database with Web Service
body: <p>I have a problem and i am new to this. I know how to create web methods to insert and delet from database but i don't know how to get something from the database. I guess i have to pass the result of the query to a string and then return this string in order to get what i want. I have the following incomplete code. </p>
  
  <pre><code>@WebMethod(operationName = "getSomethingByID")
  public String getSomethingByID(@WebParam(name = "idRocks")
  String idRocks) {
      Dal dal = new Dal();
      ResultSet rs = dal.executeQuery("SELECT rocks FROM something WHERE idRocks ='" + idRocks+ "'");
  
          try
          {
              if(rs.next())
              {
  
  
              }
          }
          catch(Exception e)
          {
              System.out.println(e.getMessage());
          }
  
          return null;
  }
  </code></pre>
  
  <p>How can i retrieve this information from database? </p>
  
  <p>thanks</p>