title: Why do I get empty brackets as a response to a http GET request
body: <p>I have a Maven Project in Java. I can successfully bring out data from my database in my testclass. However, when I do a GET request from Postman to webb Service it simply wont give me a response with the array in JSON format. It only returns an empty []. I have been at this now for more than 30 hours and can't fix it. </p>
  
  <p>I have tried converting it to JSON before hand using GSON. I have tried the methods I use to bring out the data from a main class, and it works succsessfully. It just doesn't work when I do it through the http request.</p>
  
  <p>//method that works to bring out the data from DB into array</p>
  
  <pre><code>public List&lt;ResultLadok&gt; getLadokResultsArrayList(){
      //----------Test få ut DB i ArrayList-------------------        
      try{
          //1. get a connection to database
          Connection conn = 
  DriverManager.getConnection("jdbc:mysql://localhost:3306/ladoksimulation", "root", "admin");
  
          //2. create a statement
          Statement myStmt = conn.createStatement();
          //3. Execute SQL query
          ResultSet myRs = myStmt.executeQuery("select * from resultat");
          //4. process the result set
          //för in resultat set in i lista genom while-statement
          while(myRs.next()){
              addResult(myRs.getString("betyg"), myRs.getInt("poäng"), myRs.getInt("provNr"),
                       myRs.getString("termin"), myRs.getString("date"), myRs.getString("kurskod"),
                       myRs.getString("kurstillfälle"));
  
          }        
      }        
      catch(Exception ex){
          System.out.println(ex.getMessage());
      }    
      //returnera listan 
      return resultList;
  } 
  </code></pre>
  
  <p>//method to add results into arrayList</p>
  
  <pre><code>public void addResult (String betyg, int poäng, int provNr, String termin, 
          String datum, String kurskod, String kurstillfälle) {
  
      ResultLadok resLadok = new ResultLadok();
  
      resLadok.setBetyg(betyg);
      resLadok.setPoäng(poäng);
      resLadok.setProvNr(provNr);
      resLadok.setTermin(termin);
      resLadok.setDate(datum);
      resLadok.setKurskod(kurskod);
      resLadok.setKurstillfälle(kurstillfälle);
  
  
      resultList.add(resLadok);        
  }
  </code></pre>
  
  <p>//the web service getting request from postman</p>
  
  <pre><code>@GET
  @Produces(MediaType.APPLICATION_JSON)
  public Response getJson() {
  
      DriverDBLadok_testing p = new DriverDBLadok_testing();
      List&lt;ResultLadok&gt; resultList = p.getLadokResultsArrayList();
  
  
      return Response.ok(resultList)
              .build();
  }
  </code></pre>
  
  <p>I expect to get out a list of the data in the DB in JSON format. Instead i get this: []</p>
  
  <p>Many thanks! </p>