Retrieve PK from Java Insert while auto commit off
Posted on 2013-12-06
I hava a series of SQL Server Insert statements that I am doing in a Java APP with the connection Auto commit OFF, (so I can revert if needed). I need to retrieve the PK for the inserted row. I tried using the "RETURN_GENERATED_KEYS" on my executeUpdate statement: statement.executeUpdate(myInsQry, Statement.RETURN_GENERATED_KEYS);
But I get unsupported operation. guess my JDBC does not suport that.
What is the best method to attack this?