If I INSERT a record into a database a using
JDBC / SQL INSERT statement, how do I get the value of the AUTOINCREMENT field that I just inserted?
In single-user, I can know that no other
thread has inserted into the same database table and do something like the following, where ID is my AUTOINCREMENT field and Items is my database table.
SELECT ID FROM Items ORDER BY ID DESC LIMIT 1
But, will this sort of thing work for multi-user? If I'm in a transaction, will I see the last ID that my transaction has inserted and not the IDs that other transactions may have inserted?
Kaydell