Is there a way to receive just acquired id by my insert query?
I am using java.sql package and I heard that there is a way without querying these keys again.
Or isn't?
Is there a way to receive just acquired id by my insert query?
I am using java.sql package and I heard that there is a way without querying these keys again.
Or isn't?
You can use this query to get your result. This query should be run in the same session which was used to perform insert.
select last_insert_id();
If you try to an auto-increment key value ,then you can see the post :
[Retrive the auto-increment field using PreparedStatement.][1]
Insert using PreparedStatement. How do I auto-increment the ID? [1]: