• 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

How do I get the id of the last updated row in javaDb?

 
Ranch Hand
Posts: 173
2
Netbeans IDE PHP Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Best ranchers!

I wish to know how to get the id of the last updated row in java? I know how to insert and update records in a database and retrieve the last inserted id of an insert statement but not how to do the same with an update statement? To update a record i assign a variable with the following command:



If I wan't the last inserted id from an insert statement i would write something like this:



Now how do you retrive the last inserted id after an update statement? My first guess is that you have to use some kind of a query / sub-query-statement for this. But I am still struggling at a very harsh level with my sql so I am very greatful for any kind of response here. Thank you for reading!
 
Master Rancher
Posts: 4663
49
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There is no "last inserted id" for an UPDATE.

There are just the records that were modified.

What is it you are trying to achieve?
 
    Bookmark Topic Watch Topic
  • New Topic