I have the following SQL Server stored procedure:
CREATE PROCEDURE MyProc
AS
BEGIN
SELECT * FROM MyTable
END
When I run this procedure using SSMS it returns a result. However, when I call this stored procedure from Java code using CallableStatement
it does not returning any result and throws the exception
Statement did not return any ResultSet
Update 1:
My Java code is
String sql = "{ call MyProc };";
CallableStatement cs = con.prepareCall(sql);
ResultSet rs = cs.executeQuery();