• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

how to retrieve the new ID of the auto_increment column

 
Keya Shah
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am using mysql database.
In my jsp page, after inserting a record in the mysql table, I need to get back the new ID generated for the auto_increment primary key column. How do I get this value?

Any help appreciated.
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64720
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Not a JSP question; moving along to the JDBC forum.
 
Roberto Spier
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello, Keya,

I do it this way:


HTH
Roberto
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic