Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8803199
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T01:16:49+00:00 2026-06-14T01:16:49+00:00

I have set up an ORMLite database in my android project. I have a

  • 0

I have set up an ORMLite database in my android project.

I have a class called RbFehler with the following field in it:

@DatabaseField(columnName = "DATUM_LA", dataType = DataType.DATE_STRING,
    format = "yyyy-MM-dd HH:mm:ss")
public Date datum_la;

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:

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);

But i always get the following error when i call:

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

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.

Can anyone tell me what I am doing wrong? I only found questions like this: ormlite read Date as 'yyyy-MM-dd'

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T01:16:51+00:00Added an answer on June 14, 2026 at 1:16 am

    I figured it out:

    Make sure that you use the right Date object in Java:

    @DatabaseField(columnName = "DATUM_LA", dataType = DataType.DATE_STRING,
     format = "yyyy-MM-dd HH:mm:ss")
    public java.util.Date datum_la;
    

    And not the java.sql.Date.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have set of flat files (114 files) each file is named with database
I have set up a datepicker in a form using the following js: $(#Expiry).datepicker({
I have set of classes which inherit from a single super class: Super |
I have set up cruisecontrol.net cs for my project that has a number of
We have set the following app settings to be iPhone only, but in the
I have set up Tapestry 5 project and all went fine, until I deployed
So I recently switched my database stuff over to ORMLite in my android tablet
I have set up the screenshot plugin from github, located here: https://github.com/phonegap/phonegap-plugins/tree/master/Android/Screenshot I set
I have set of 30 matrices called index.1 to index.30 in a list listname
I have set up an ASP.NET MVC project, and everything is working great, but

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.