I have a auto increment column of type bigint. Calling mysql_insert_id() works good for getting the previously inserted id for the connection. Does it work great(identifying the last inserted id) even if a connection pool in a tomcat container is used ?
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
回答1:
Don't use database specific code like that, it'll only make your code less portable. Instead use the Statement.RETURN_GENERATED_KEYS
option when executing an update.
Here's a start to your searches: sql jdbc getgeneratedkeys returns column "id" not found, column type unknown