android - jTDS / JDBC call Store Procedure, error… getMoreResults() -


here code of ms sql server stored procedure have 1 input , 1 output parameter :

alter procedure [dbo].[additem] @numer nvarchar(50) , @ff int output begin     select category = @ff     [awe_database].[dbo].[items]     catalog_number=@numer      end 

and try run on phone ( using android studio). connect database use jtds-1.3.1 library.

try {  callablestatement cs ;               cs = this.connect.preparecall("{call additem(?,?)}");               cs.setstring(1, c);               cs.registeroutparameter(2, java.sql.types.integer);                int s = cs.getint(2);                cat = getstring(s);                toast.maketext(getapplicationcontext(), cat, toast.length_short).show();  } catch (sqlexception e) {e.printstacktrace(); } 

i such error:

java.sql.sqlexception: output parameters have not yet been processed. call getmoreresults(). 

i searched forum find sollution , tryed many examples no 1 works. how shoudl use getmoreresults() ? or other wrong ? add run procedures return many parameters , works. procedure have input parameter.

i beginner in programming. please help


Comments

Popular posts from this blog

javascript - Chart.js (Radar Chart) different scaleLineColor for each scaleLine -

apache - Error with PHP mail(): Multiple or malformed newlines found in additional_header -

java - Android – MapFragment overlay button shadow, just like MyLocation button -