如何使用jsp和mysql获取最后插入的文件 [英] how to get last inserted it using jsp and mysql
本文介绍了如何使用jsp和mysql获取最后插入的文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
嗨 谁能告诉我如何使用jsp和mysql获取最后插入的ID ...?
Hi can any one tell me how can i get last inserted id using jsp and mysql...?
推荐答案
尝试更改您的执行查询:
Hi,
Try changing your execute query:
numero = stmt.executeUpdate(query);
至:
to:
numero = stmt.executeUpdate(query, Statement.RETURN_GENERATED_KEYS);
请参考以下链接:
http://dev.mysql.com/doc/refman/5.0/en/Getting-unique-id.html [ ^ ]
--Amit
Refer the links below:
http://dev.mysql.com/doc/refman/5.0/en/getting-unique-id.html[^]
--Amit
这篇关于如何使用jsp和mysql获取最后插入的文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文