aspose file tools*
The moose likes JDBC and the fly likes ORA-01861 literal does not match format string Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "ORA-01861 literal does not match format string" Watch "ORA-01861 literal does not match format string" New topic
Author

ORA-01861 literal does not match format string

Mohd Asim
Greenhorn

Joined: Jul 04, 2007
Posts: 24
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

Joined: Dec 20, 2006
Posts: 2503
    
    8

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


OCUP UML fundamental and ITIL foundation
youtube channel
 
jQuery in Action, 2nd edition
 
subject: ORA-01861 literal does not match format string