How can we pass array to SQL server stored procedure using JAVA? -
i want call sql server stored procedure passing array_list.
string[][] array1=new string[2][2]; array1[0][0]="a"; array1[0][1]="b"; array1[1][0]="c"; array1[1][1]="d"; string name="test"; string spsql="exec sp_name ?,?,?"; preparedstatement stmt=con.preparedstatement(spsql); stmt.setstring(1, name); stmt.setarray(2,array1);
the last line giving error. not able set array there. tried list no use.
you should try pass comma separated string instead of array , use in query.
Comments
Post a Comment