Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Prepared Statement.. when it fails what to do ?

 
Anonymous
Ranch Hand
Posts: 18944
  • Mark post as helpful
  • send pies
  • 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
 
Michal Harezlak
Ranch Hand
Posts: 185
  • Mark post as helpful
  • send pies
  • 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?
 
seemalk
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • 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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic