Win a copy of Svelte and Sapper in Action this week in the JavaScript forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
Bartenders:
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

JDBC Batch updates(Oracle jdbc api & jdbc2.0)

 
Ranch Hand
Posts: 93
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm trying to do an update using Oracle JDBC api but it always returns me 0 irrespective whether a record is succesfully updated or not.I need to differentiate
between the successful update & unsuccessfull update.Basing on the result I need to perform some action
if(successfull){
ignore
}else{
insert
}
Is there any way I can differentiate whether a record is succesfully updated or not.



Later I tried with JDBC 2.0 for batch updates,the problem still persists this always returns -2 whether a record is succesfully updated or not

Request you to let me know if any of you have some kind solution for this,any help highly appreciated
 
Ranch Hand
Posts: 874
Android VI Editor Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Naveen,


Do you like to know how to produce a unsuccessfull update ? Create a unique constraint , or some NULL constraint and try to update the record , you would get unsuccessful udpate , for other case you should get positive integer.

getUpdateCount() would give you the results.
 
Wanna see my flashlight? How about this tiny ad?
the value of filler advertising in 2020
https://coderanch.com/t/730886/filler-advertising
    Bookmark Topic Watch Topic
  • New Topic