• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

purpose of using statement.getGeneratedKeys

 
RaviNada Kiran
Ranch Hand
Posts: 528
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
when going through forums in velocity reviews i came across this :

The thing I want to know is, how do I find out what the new value of an
autonumber field is when I add a new record?

and one of them answered as "Well, getGeneratedKeys() is "the" way to do it".


Please what is the purpose of getGeneratedKeys() from Statement??

 
Bauke Scholtz
Ranch Hand
Posts: 2458
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It returns a ResultSet.

Have you explored it? Wouldn´t you logically expect the generated key in it?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic