How to call a sp in Sql server which has no Out parameter
Hi all,
I am trying to call a stored procedure in Sql Server through jdbc. The Stored Procedure has no out parameter in it. It has a select query at the end which retrieves some rows when
we execute the procedure. When I execute the procedure in the sql server I am able to see the output rows but when I am trying to invoke the SP I am getting an exception
pasted below:
Exception in thread "main" com.microsoft.sqlserver.jdbc.SQLServerException: The statement did not return a result set.
at com.microsoft.sqlserver.jdbc.SQLServerException.makeFromDriverError(SQLServerException.java:190)
at com.microsoft.sqlserver.jdbc.SQLServerPreparedStatement.doExecutePreparedStatement(SQLServerPreparedStatement.java:408)
at com.microsoft.sqlserver.jdbc.SQLServerPreparedStatement$PrepStmtExecCmd.doExecute(SQLServerPreparedStatement.java:350)
at com.microsoft.sqlserver.jdbc.TDSCommand.execute(IOBuffer.java:5696)
at com.microsoft.sqlserver.jdbc.SQLServerConnection.executeCommand(SQLServerConnection.java:1715)
at com.microsoft.sqlserver.jdbc.SQLServerStatement.executeCommand(SQLServerStatement.java:180)
at com.microsoft.sqlserver.jdbc.SQLServerStatement.executeStatement(SQLServerStatement.java:155)
at com.microsoft.sqlserver.jdbc.SQLServerPreparedStatement.executeQuery(SQLServerPreparedStatement.java:285)
at sqlserverspcall.SqlServerSPCall.main(SqlServerSPCall.java:50)
Could it be because of not having Out parameter in the procedure. I guess the ResultSet comes only if the procedure has an Out parameter. Is there a way to get the output from
this kind of procedures. Please help me.
Thanks In Advance