I'm not good in sql server (Actually I have no experience on it).
But in the database that I used now in my work, we declare an output parameter. Output parameter is different from input parameter.
I believe that this is how it goes in sql server:
if you are going to pass Input parameters, then declare it. and if you want an output parameter, declare it also as output
CREATE PROCEDURE MY_PROCEDURE (
@THIS_IS_INPUT_PARAMETER NVARCHAR(50),
@THIS_IS_OUTPUT_PARAMETER NVARCHAR OUTPUT)
AS
SELECT @THIS_IS_OUTPUT_PARAMETER = COLUMN_NAME FROM TABLE_NAME WHERE ANOTHER_COLUMN_NAME = @THIS_IS_INPUT_PARAMETER
in java part, first parameter is input, and second parameter is the output. Meaning there is not third parameter and so on, so getting a value from parameter greater than 2 will cause a sql exception.
I suggest you to study the ref cursor in sql and resultset in java. that might help you do want you want.