• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

update problem in oracle

 
Ranch Hand
Posts: 122
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 ]
 
Bartender
Posts: 10336
Hibernate Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I would suggest, for such a big update, you should use PreparedStatement.
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic