File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes JDBC and Relational Databases and the fly likes update problem in oracle 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 "update problem in oracle" Watch "update problem in oracle" New topic

update problem in oracle

visu Nekk
Ranch Hand

Joined: Sep 06, 2005
Posts: 122

Using the above code i am able to update the data only if i update the Interview_Date column.Otherwise i am getting an error of type

java.sql.SQLException: ORA-01861: literal does not match format string

i am unable to figure out the problem.could somebody help me out

[edited to add code tags and line breaks]
[ October 06, 2005: Message edited by: Jeanne Boyarsky ]
Paul Sturrock

Joined: Apr 14, 2004
Posts: 10336

If you want to update a DATE datatype (I'm guessing thats what the Interview_Date field's data type is, correct me if I'm wrong) and you are doing it with a Statement, you need to make sure that the format of the String you use to represent the date matches the format defined in the database. Now you could do this, or you could use a TO_DATE PL/SQL function, but far better is to use a PreparedStatement and bind the date. Then the format does not matter.

JavaRanch FAQ HowToAskQuestionsOnJavaRanch
Santosh Rathi

Joined: May 12, 2005
Posts: 5
I would suggest, for such a big update, you should use PreparedStatement.
I agree. Here's the link:
subject: update problem in oracle
It's not a secret anymore!