title: Insert timestamp with JdbcTemplate in Oracle database ( ORA-01858 )
body: <p>I've read a lot of stuff about this error, and still not found the mistake.</p>
  
  <p>I'm using JdbcTemplate to insert a row in some table with some timestamp column 
  I'm pretty sure the timestamp is the problem, as if delete from the insert it works fine)</p>
  
  <p>My code:</p>
  
  <pre><code>        private static final String INSERT_CITAS = "INSERT INTO CITAS (" 
          + "idCita, idServicio, " + "fechaCita, "
          + "idEstado, idUsuarioInicial) " + "VALUES (?, ?, ?, ?, ?)";
  
          Object[] params = {
                  idCita,
                  citaQuenda.getIdServicio(),
                  getDateToDBFormat(citaQuenda.getFechaCita()),
                  ESTADO_INICIAL,
                  USUARIO_INICIAL };
  
          String queryCitas = INSERT_CITAS;
  
          super.getJdbcTemplate().update(queryCitas, params);
  
  
          protected String getDateToDBFormat(Date fechaCreacion){
          return  "TO_TIMESTAMP('" + 
                      new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(fechaCreacion)
                      + "', 'yyyy-mm-dd hh24:mi:ss')" ;
          }
  </code></pre>
  
  <p>And having the next error:</p>
  
  <pre><code>    org.springframework.dao.DataIntegrityViolationException: PreparedStatementCallback; SQL [INSERT INTO citas_55 (idCita, idServicio, fechaCita, idEstado, idUsuarioInicial) VALUES (?, ?, ?, ?, ?)];
      ORA-01858: a non-numeric character was found where a numeric was expected
  </code></pre>
  
  <p>I've tried to execute the sql in some SQL editor having success, so I can't be more confused.   </p>
  
  <p>Being my params: [461, 100, TO_TIMESTAMP('2015-01-28 00:00:01', 'yyyy-mm-dd hh24:mi:ss'), 1, 8888]  This actually works.</p>
  
  <pre><code>    INSERT INTO citas (idCita, idServicio, fechaCita, idEstado, idUsuarioInicial) VALUES (457, 100, TO_TIMESTAMP('2015-01-28 00:00:01', 'yyyy-mm-dd hh24:mi:ss') , 1, 8888);
  </code></pre>
  
  <p>Any kind of help would be appreciated. Thanks in advance!</p>