• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

ORA-01861 literal does not match format string

 
Mohd Asim
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i have a bean called module that i want to commit to the database. it has 2 date fields i.e dateCreated and dateModified. now i am using this sql query to update the fields:


but it gives me a "ORA-01861 literal does not match format string" exception.

i have even checked both my module date fields and oracle date fields. both match in format but still i am unable to update.

any ideas???
 
Jan Cumps
Bartender
Posts: 2584
11
C++ Linux Netbeans IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Oracle uses the date format DD-MON-YYY (country dependent).
Your date.toString() does not return the date in that format.
Why don't you use parameter binding?
Then you can insert the date using statement.setDate().

Regards, Jan
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic