title: Insert dd/mm/yyyy date format into database table
body: <p>I am trying to insert a dd/mm/yyyy date format into my database table. The data type for date column in database is date and my SQL insert statement is:</p>
  
  <pre><code>INSERT INTO sm_product(productName, productDescription, productPrice, productQuantity, productStatus)
  VALUES ('" + name + "', '" + desc + "', " + price + ", " + quantity + ", 'Available', '" + date + "'";
  </code></pre>
  
  <p>However, netbeans shows me an error when I added the date variable into the SQL statement.</p>
  
  <blockquote>
    <p>You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1</p>
  </blockquote>
  
  <p>And it stores the date as: </p>
  
  <blockquote>
    <p>Wed Jun 19 17:42:26 SGT 2013</p>
  </blockquote>
  
  <p>And I got my dd/mm/yyyy date format in user interface:</p>
  
  <pre><code>DateFormat dateFormat = new SimpleDateFormat("dd/MM/yyyy");
  Date date = new Date();
  dateFormat.format(date);
  </code></pre>
  
  <p>This format is not I wanted. So I wonder how should I amend my SQL statement to fix the problem.</p>
  
  <p>Thanks in advance.</p>