This approach should work:
1.) Return @@IDENTITY from your stored proc.
...RETURN @@IDENTITY
2.) Declare a CallableStatement: "{? = call your_sp(?)}"
3.) Register Out parameter: cs.RegisterOutParameter(1, Types.INTEGER);
4.) Set parameters: cs.setString(2,"test");
4.) Call sp: cs.executeUpdate();
5.) get value: cs.getInt(1);
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.