This week's book giveaway is in the Agile and other Processes forum.
We're giving away four copies of The Mikado Method and have Ola Ellnestam and Daniel Brolund on-line!
See this thread for details.
The moose likes JDBC and the fly likes update problem in oracle Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Databases » JDBC
Reply Bookmark "update problem in oracle" Watch "update problem in oracle" New topic
Author

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
Bartender

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
Greenhorn

Joined: May 12, 2005
Posts: 5
I would suggest, for such a big update, you should use PreparedStatement.
 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: update problem in oracle
 
Similar Threads
jsp insert program not working
String Concatination
problem retrieving from database
ID:2 SCJP Question of the day : Thursday June 10 2010
Strings