title: Exception while input a date into a MySQL database
body: <p>I have a <code>MySQL</code> database and want to write a row into it. The problem is that <code>MySQL</code> do not like my <code>query</code>, why? This is my <strong>code</strong>:</p>
  
  <pre><code>java.sql.Timestamp date = new java.sql.Timestamp(new java.util.Date().getTime());
  
  for (Integer articlevalue : articlesendlist) {
      for (Integer suppliervalue : suppliersendlist) {
          connection.executeQuery("INSERT INTO Bestellungen(Bestellung_ID, Artikel_ID, Lieferant_ID, Datum, Preis) VALUES (" + maxorder + ", " + articlevalue + ", " + suppliervalue + ", " +  date + ", NULL)");
      }
  }
  </code></pre>
  
  <p>A small description for my code. The <code>articlesendlist</code> contains IDs from selected values from a <code>JTabel</code>. The same applies to the <code>suppliersendlist</code>. I want to write the IDs into the table "<code>Bestellung</code>". The variable <code>maxorder</code> is the current ID for the table "<code>Bestellung</code>".</p>
  
  <p>If you need it, the <strong>exception</strong> is:</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 '12:45:06.164, NULL)' at line 1</p>
  </blockquote>
  
  <p><em>Please do not comment/answer with other links, I already searched for the problem and read several sites. They do not help me or are not suitable for my problem.</em></p>
  
  <ul>
  <li>Thank you for help</li>
  </ul>