Statement.getLastInsertID( ) returns a different number than what I expect
Posted by: supun edirisinghe
Date: April 18, 2005 04:39PM

I'm using connector/J 3.0 - general release.

I'm inserting a row to an autoincremented int primary keyed table and then inserting the id of that insert into another able. I want to use Statement's getLastInsertID( ), but that gives me a number much smaller than the actual biggest ID in the table. I'm managing my connections so that only one thread goes through the code at any one time, and my application is the only client that will access the db. When I execute my statements in the command line mysql client and get the last inserted ID via "select LAST_INSERT_ID()" it works as expected.

Is there a bug in the in my version of connector J? anybody else see this behavior?

thanks

Options: ReplyQuote


Subject
Written By
Posted
Statement.getLastInsertID( ) returns a different number than what I expect
April 18, 2005 04:39PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.