• 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

Prepared Statement.. when it fails what to do ?

 
Ranch Hand
Posts: 18944
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
I am trying to updating a table using prepared statement using executeupdate(). I need to write to a reject file if my update fails , the rejected resultset. I have tried to use
getresultset() on preparedstatement and it does not work. Any Ideas on solving the puzzle.
Thanks,
Kanthadai
 
Ranch Hand
Posts: 185
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am not sure what your problem is. If the update statement is fault the exception will be thrown and if it simply dose not update anything it will return 0 (number of updatet rows). What other information are you looking for?
 
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Mr.raja,
let me try and help.An executeUpdate returns to u an integerand not a resultset.hence u wont be getting any resultset.U can try checking for a nonzero number returned by executeUpdate() to signify a sucess.this should do the job.Again,this is just a suggestion ,please correct me if I'am wrong.
Seema Kamath
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic