File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/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 OCA/OCP Java SE 7 Programmer I & II Study Guide this week in the OCPJP 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: 2504
    
    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
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: ORA-01861 literal does not match format string