I am using java to access mssql 2012 DB
I have a stored procedure "procX" with takes only 1, (say named as @p1) in parameter and returns a single result set. It works fine unless I try to read the return value before I get the result set. Code is below. If I remove "//" and get return value, I get null
as the result.
cs = con.prepareCall("{? = call procX(?)}");
cs.registerOutParameter(1, Types.INTEGER);
cs.setInt("p1", 1);
cs.execute();
//cs.getInt(1);
rs = cs.getResultSet();
And even if I read the return value after I get the resultset, this closes the result set.
Is there a way to read return value without making it impossible to get the resultset?
And as far as I can see this situation is not restricted for return value and occurs for any other output parameters, too.