title: How to insert a string date to a mysql database date field
body: <p>I'm trying to insert a date String from my Java program to one of my MySQL database fields that has a date type. </p>
  
  <pre><code>package events;
  
  import java.sql.Connection;
  import java.sql.DriverManager;
  import java.sql.Statement;
  import java.util.Date;
  /**
  *
  * @author mewq
  */
  public class ConDb {
  public static void main(String[] args){
  String description = null;
  try{
  Connection conn = (Connection) DriverManager.getConnection("jdbc:mysql://localhost/tangkilikan", "user=root", "password=tangkilik");
  
  Statement stat = (Statement) conn.createStatement();
  
  String eventName = "Imba meeting";
  String Address = "Zamora, Cabarroguis, Quirino";
  Date date = '2011-09-09'; 
  String description = "meeting";
  
  
  String insert = "insert into events values ('" + eventName + "', '" + Address + "', ' + date + ', '" + description + "')";
  
  
  stat.executeUpdate(insert);
  
  } catch(Exception e) {
  
  }
  
  }
  
  }
  </code></pre>