SQL Server JDBC returns many result set when a stored procedure invoked
By default SQL Server JDBC driver returns result set of all SELECT query executed in a stored procedure. I have to call CallableStatemen开发者_Go百科t.getMoreResults() and close all of them. I do not want any result set as return value when executing SQL Server stored procedurel; are there any ways to prevent returning result set when executing SQL Server stored procedure?
I'm not sure I understand. Are you executing select statements within your procedure that you don't want returned? Is it the rows affected that is being returned that is the result set you don't want? If its the latter you can add SET NOCOUNT ON to the beginning of the procedure to keep the rows affected from being returned.
statement.executeUpdate()
should execute your sql without returning a resultset.
精彩评论