wood burning stoves 2.0*
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 Murach's Java Servlets and JSP this week in the Servlets 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: 2491
    
    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
 
Similar Threads
ORA-01861: literal does not match format string
SQLException: ORA-01861: literal does not match format string
ORA 01861 - literal does not match format string
ORA-01861: literal does not match format string
java.sql.SQLException: ORA-01861: literal does not match format string