title: Spring Data JPA How to pass a date parameter
body: <p>I'm working in a spring MVC project and spring data with spring tools suite, I want to pass a date argument to a native query, I have this so far.</p>
  
  <p>My query method inside a interface that extends JpaRepository</p>
  
  <pre><code> @Query(value  = 
              "SELECT "
                  + "a.name, a.lastname
              + "FROM "
                  + "person  a, "
                  + "myTable b "
              + "WHERE "
              + "a.name= ?1' "
              + "AND a.birthday = ?2 ",
           nativeQuery = true)
      public ArrayList&lt;Object&gt; personInfo(String name, String dateBirthDay);
  </code></pre>
  
  <p>The method that implements this interface definition:</p>
  
  <pre><code>public ArrayList&lt;Object&gt; getPersonsList(String name, String dateBirthDay) {
  
              ArrayList&lt;Object&gt; results= null;
  
              results= serviceAutowiredVariable.personInfo(name, dateBirthDay);
  
              return results;
          }
  </code></pre>
  
  <p>and this is how I call it from my controller class.</p>
  
  <pre><code>personsList= _serviceAutowiredVariable.getPersonsList("Jack", "TO_DATE('01-08-2013', 'DD-MM-YYYY')" );
  </code></pre>
  
  <p>I suppose that in this line <code>"AND a.birthday = ?2 "</code>   the <code>?2</code>is equals to this string <code>TO_DATE('01-08-2013', 'DD-MM-YYYY')</code></p>
  
  <p>but I am getting this error when I run my code </p>
  
  <pre><code>    [Request processing failed; nested exception is org.springframework.orm.jpa.JpaSystemException: org.hibernate.exception.DataException: could not extract ResultSet; nested exception is javax.persistence.PersistenceException: org.hibernate.exception.DataException: could not extract ResultSet] root cause
  java.sql.SQLDataException: ORA-01858: a non-numeric character was found where a numeric was expected
  
  ERROR: org.hibernate.engine.jdbc.spi.SqlExceptionHelper - ORA-01858: a non-numeric character was found where a numeric was expected
  </code></pre>