title: Cant get records between two dates
body: <p>My problem is that I can't fetch all records that are between two dates.</p>
  
  <p>I have two <code>JDateChooser</code>s.  When I select two dates like '10-apr-2011' to '20-apr-2011' I want all the records between those dates to be displayed in my <code>JList</code>. But I can't get any results in the <code>JList</code>.</p>
  
  <p>I am using mysql database.</p>
  
  <pre><code>  private void Display(java.awt.event.ActionEvent evt) {
  
      try 
      { 
  
          Class.forName("com.mysql.jdbc.Driver");  
          Connection con= 
             (Connection)DriverManager.getConnection(
               "jdbc:mysql://localhost:3306/test","root","ubuntu123");   
          java.util.Date jd =  jDateChooser1.getDate();
          java.util.Date jd1 = jDateChooser2.getDate();
  
          // PreparedStatement stmt = (PreparedStatement) con.prepareStatement("select date from invoice where date = ?);
  
          // PreparedStatement pstmt = (PreparedStatement) con.prepareStatement("SELECT date FROM invoice WHERE date BETWEEN ' ' AND ' '");
  
          PreparedStatement pstmt = (PreparedStatement) con.prepareStatement("SELECT date FROM invoice WHERE date &gt;= '+jd + ' AND date &lt;= '+jd1 + '");
  
          pstmt.execute();  
  
          ResultSet rs = pstmt.getResultSet();
  
          int i =0;
          DefaultListModel listModel = new DefaultListModel();
  
          while(rs.next())
          {   
  
              String [] data;
              data = new String[100];
              data [i] = rs.getString("date");
              jList1.setModel(listModel);
              listModel.addElement(data [i]);
              i = i+1;
  
          }
      } 
      catch (Exception e) 
      {
          System.out.println("2nd catch  " + e);
      }        
  }
  </code></pre>
  
  <p>Can anyone tell me where my mistake is?
  Thanks in advance..</p>