title: ORMLite insert Date with SQL
body: <p>I have set up an ORMLite database in my android project.</p>
  
  <p>I have a class called RbFehler with the following field in it:</p>
  
  <pre><code>@DatabaseField(columnName = "DATUM_LA", dataType = DataType.DATE_STRING,
      format = "yyyy-MM-dd HH:mm:ss")
  public Date datum_la;
  </code></pre>
  
  <p>I have some logic that imports the data from a text file where the SQL-insert statements are stored. One line would look like this:</p>
  
  <pre><code>INSERT INTO RbFehler (KATALOGART,SYST,SUBSYST,KOMP,BAUTEIL,BEZ,PSYST,PSUBSYST,
      PKOMP,PBAUTEIL,INAKTIV,GELOESCHT,DATUM_LA)
      VALUES ('VW','4F5AB211','0600','4F5AA900','0010','Venturirohr','4F5AB211',
          '0600','4F5AA900','0000','0','0',2012-06-04 08:08:08);
  </code></pre>
  
  <p>But i always get the following error when i call:</p>
  
  <pre><code>dao.execute RawNoArgs(line);
  
  java.lang.Illegal Argument Exception: Field class java.sql.Date for field
      Field Type:name=datum_la,class=RbFehler is not valid for data
      persister com.j256.ormlite.field.types.DateStringType@416ed260
  </code></pre>
  
  <p>I have also tried to add " ' " around the date in the SQL-statement but get the same error.  If I remove the date from the SQL and the class everything works fine.</p>
  
  <p>Can anyone tell me what I am doing wrong? I only found questions like this: <a href="https://stackoverflow.com/questions/12847484/ormlite-read-date-as-yyyy-mm-dd">ormlite read Date as &#39;yyyy-MM-dd&#39;</a></p>