wood burning stoves
The moose likes JDBC and Relational Databases and the fly likes  how to get last inserted row in MySql through JSP Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Building Microservices this week in the Design forum!
JavaRanch » Java Forums » Databases » JDBC and Relational Databases
Bookmark " how to get last inserted row in MySql through JSP" Watch " how to get last inserted row in MySql through JSP" New topic
Author

how to get last inserted row in MySql through JSP

Chintan Shah
Greenhorn

Joined: Jun 29, 2005
Posts: 27
Hi,
I am trying to get the last inserted row in MySql..but not able to fetch it.
this is what i used
i have one column order_id which is auto_increment
SELECT * FROM tablename WHERE order_id=(SELECT MAX(order_id) FROM tablename)
any help is appreciated .
the usage of lastinsert() method is also not successful
chintan
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 63227
    
  69

Moved to the JDBC forum.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
 
I’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link: http://aspose.com
 
subject: how to get last inserted row in MySql through JSP
 
It's not a secret anymore!