This week's book giveaway is in the Design forum.
We're giving away four copies of Design for the Mind and have Victor S. Yocco on-line!
See this thread for details.
Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

update problem in oracle

 
visu Nekk
Ranch Hand
Posts: 122
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

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
Posts: 10336
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Santosh Rathi
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I would suggest, for such a big update, you should use PreparedStatement.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic