Sequence of Fetching Result Sets and Out Parameters
For Microsoft SQL Server stored procedures that return a result set, the SQL Server driver returns the OUT parameters only after the result sets are returned. Hence, fetchReturnParams() should be called only after completely processing all the result sets, otherwise the buffers bound to the OUT parameter will not have the correct output value.