title: Insert date into MySql Database using JavaFX Datepicker
body: <p>I'm trying to insert date to mysql database from data-picker using javaFx.
  I am tired by submit this code.</p>
  
  <pre><code>@FXML
  private DatePicker DPCurrentDate;//fx:id="DPCurrentDate"
  
  // BrandAdded is a Method that i created for insert data into database
  
  private void BrandAdded(){
  
      DBConnection newCon = new DBConnection();
      con = newCon.geConnection();
  
      try {
          pst = con.prepareStatement("insert into Brands values(?,?,?,?,?)");
          pst.setString(1, null);
          pst.setString(2, TFBrandName.getText());
          pst.setString(3, TABrandDecription.getText());
          pst.setString(4, lblUserName.getText());
          pst.setDate(5, DPCurrentDate.getValue());
          pst.executeUpdate();
  
      } catch (SQLException ex) {
          Logger.getLogger(AddBrandController.class.getName()).log(Level.SEVERE, null, ex);
      }
  }
  </code></pre>
  
  <p>when i run my program it give me this error</p>
  
  <pre><code>error: incompatible types: LocalDate cannot be converted to Date
          pst.setDate(5, DPCurrentDate.getValue());
  </code></pre>