I used Java JDBC to call a SQL Server Stored Procedure and got a NullPointerException from the last line of the following innocent code below:
rs = stmt.getResultSet();
while (rs.next()) ...
The stored procedure looks like:
select ... from ...
It turns out that 'SET NOCOUNT ON' should be added into the stored procedure before the 'operation 1'.