title: search database by date
body: <p>I want to search column called <code>name</code> in my <code>work</code> table by searching date. Other columns are <code>id(primary key) and mydate</code>. I can't find what is wrong with my code. I'm using jdbc class for db connection. <br/> <br/></p>
  
  <pre><code>    private void jButton1ActionPerformed(java.awt.event.ActionEvent evt)             {                                         
     String date1 = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(jDateChooser1.getDate());
      String time1 = dateSpinner1.getValue().toString().split(" ")[3];
      date1 = date1 + " " + time1;
  
      try {
          ResultSet rs =db.getData("SELECT * FROM work WHERE mydate = '"+date1+"'");
        while (rs.next()) {                
             String name = rs.getString("name");
           System.out.println(name);
          }
      } catch (Exception e) {
          e.printStackTrace();
      }
  }
  </code></pre>