aspose file tools*
The moose likes JDBC 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 Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Databases » JDBC
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: 61419
    
  67

Moved to the JDBC forum.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: how to get last inserted row in MySql through JSP