This week's book giveaway is in the OO, Patterns, UML and Refactoring forum.
We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line!
See this thread for details.
The moose likes JDBC and Relational Databases 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


JavaRanch » Java Forums » Databases » JDBC and Relational Databases
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: 2543
    
  10

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
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: ORA-01861 literal does not match format string
 
jQuery in Action, 3rd edition