Win a copy of Transfer Learning for Natural Language Processing (MEAP) this week in the Artificial Intelligence and Machine Learning 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 ...
  • Campbell Ritchie
  • Tim Cooke
  • Paul Clapham
  • Devaka Cooray
  • Bear Bibeault
  • Junilu Lacar
  • Knute Snortum
  • Liutauras Vilda
Saloon Keepers:
  • Ron McLeod
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Piet Souris
  • salvin francis
  • Carey Brown
  • Frits Walraven

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

Ranch Hand
Posts: 170
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!
Posts: 4545
  • 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?
Forget Steve. Look at this tiny ad:
Two software engineers solve most of the world's problems in one K&R sized book
    Bookmark Topic Watch Topic
  • New Topic