This article was reproduced from: http://hedyn.iteye.com/blog/856040
The following exception occurred when invoking a stored procedure in SQL Server in JDBC:
Com.microsoft.sqlserver.jdbc.SQLServerException: The statement did not return a result set. At Com.microsoft.sqlserver.jdbc.SQLServerException.makeFromDriverError (Sqlserverexception.java:171) at Com.microsoft.sqlserver.jdbc.SQLServerPreparedStatement.doExecutePreparedStatement (sqlserverprepared Statement.java:394) at Com.microsoft.sqlserver.jdbc.sqlserverpreparedstatement$prepstmtexeccmd.doexecute (SQLServerPreparedS Tatement.java:340) at Com.microsoft.sqlserver.jdbc.TDSCommand.execute (Iobuffer.java:4575) at Com.microsoft.sqlserver.jdbc.SQLServerConnection.executeCommand (Sqlserverconnection.java:1400) at Com.microsoft.sqlserver.jdbc.SQLServerStatement.executeCommand (Sqlserverstatement.java:179) at Com.microsoft.sqlserver.jdbc.SQLServerStatement.executeStatement (Sqlserverstatement.java:154) at Com.microsoft.sqlserver.jdbc.SQLServerPreparedStatement.executeQuery (Sqlserverpreparedstatement.java :283)
Workaround: Add the first line of the stored procedure
SET on