title: Java JDBC SQL Syntax error with PreparedStatement.setTimestamp. Value gets cut off at the colon ':' in time
body: <p>Whenever I try to execute a prepared statement, it throws a <code>MySQLSyntaxErrorException</code> with:</p>
  
  <blockquote>
    <p><strong>You have an error in your SQL syntax; check the manual that corresponds to your<br>
    MySQL server version for the right syntax to use
    near 'INSERT INTO    Information (stamp) VALUES ('2017-01-24 1' at
    **line 1</strong></p>
  </blockquote>
  
  <p>It looks like it's getting cut off at the colon ":' of the time part of the format. </p>
  
  <pre><code>String sql = "INSERT INTO Information (stamp) VALUES (?);"
  ...
  statement.setTimeStamp(1, new Timestamp(system.currentTimeMillis()));
  </code></pre>
  
  <p>I've tried a bunch of different ways of getting a system time stamp and converting it to java.sql.Timestamp, but it continues to throw that same error.</p>
  
  <p>My table has a column stamp of type TIMESTAMP.</p>