Friends, I just wanted to know that how would u get the value of a variable (which is an output parameter in sql server) by calling it in java. example create procedure proc1 (@a varchar(10), @id varchjar(3) as begin select @id=@a+' returned value' end above is a procedure made in MS sql server. now what i want is by calling this procedure in java sending two variables and getting the value of second variable if possible make a program thank u
Something like this.... Connection con .... make connection Statement stmt = con.createStatement(); ResultSet rst = stmt.executeQuery("exec proc1 'arg1', 'arg2'"); rst.next(); String result = rst.getString(0); This would be the basic framework. You could use PreparedStatement for more dynamic content with your query... Sorry in advance if my syntax is wrong....
Todd Bush<BR>AIM: RalphWiggam14
subject: getting values by calling stored proc. in sql server