title: select rows between two dates in sqlite using java
body: <p>select rows between two dates in sqlite using java.
  When i try to retrieve rows between to two dates from sqlite database in javafx program i always get one row from the whole rows even if there is multiple rows it select the first row and discard the remaining or not included in the result set at all, how can solve this problem and again the database has some records but the query always return the first one</p>
  
  <pre><code>@FXML
  private void report(ActionEvent event)
  {
      if(searchfromDate.getValue() != null &amp;&amp; searchToDate.getValue() != null)
      {
          try
          {
              DBconnector.connect();
  
              LocalDate startDate = searchfromDate.getValue();
              LocalDate endDate = searchToDate.getValue();
  
              String query = "select * from selled where date between '" + startDate
                             + "' and '" + endDate + "'";
              ResultSet rs = DBconnector.query(query);
              Alert alert = new Alert(AlertType.INFORMATION);
  
              JSONObject file = new JSONObject();
  
              if(rs.next())
              {
                  int id = rs.getInt("id");
                  String customer = rs.getString("costomer");
                  String name = rs.getString("name");
                  String barcode = rs.getString("barcode");
                  int amount = rs.getInt("amount");
                  LocalDate date = LocalDate.parse(rs.getString("date"));
                  double price = rs.getDouble("price");
                  String garentee = rs.getString("garentee");
  
                  file.put("id", id);
                  file.put("customer", customer);
                  file.put("name", name);
                  file.put("barcode", barcode);
                  file.put("amount", amount);
                  file.put("date", date);
                  file.put("price", price);
                  file.put("garentee", garentee);
              }
  
              FileWriter writer = new FileWriter("تقرير المبيعات.json");
  
              writer.write(file.toString());
              writer.flush();
              writer.close();
  
              alert.setTitle("رسالة تاكيد");
              alert.setHeaderText(null);
              alert.setContentText("تم استخراج الملف بنجاح");
              alert.showAndWait();
  
              Desktop desktop = Desktop.getDesktop();
              desktop.browse(new URI("https://arabsefr.com/save-report?fbclid=IwAR2ON1Tl8ETQ--3QEAVFJLMjTuWUhpLCZrD3PXhg8TZpdlUH4umKBfl78OM"));
          }
  
          catch (Exception ex)
          {
              System.out.println(ex);
          }
      }
  
      else
      {
          Alert alert = new Alert(AlertType.INFORMATION);
  
          alert.setTitle("رسالة تاكيد");
          alert.setHeaderText(null);
          alert.setContentText("لم يتم تحديد التاريخ");
          alert.showAndWait();
      }
  }
  </code></pre>