Link to home
Start Free TrialLog in
Avatar of kishan66
kishan66Flag for United States of America

asked on

Array required, but java.sql.Array found

Hi,

I am getting the Error at
"out.println("The object present is " + arrobj[1]);"

where ---------------------    
       
         Object[] obj;
        Object[] obj_sat3;

      obj_sat3 = ar2.toArray();
      obj = ar.toArray();

          session.setAttribute("obj1",obj);
      session.setAttribute("obj3",obj_sat3);
      Array arrobj = (Array)session.getAttribute("obj1");
        out.println("The object present is " + arrobj[1]);
------------------------------------------

but when i just use the obj object rather than session name "obj1" it works fine....
out.println("The object present is " + obj[1]);

Environment:-- JSP

thanks
Avatar of Gurvinder Pal Singh
Gurvinder Pal Singh
Flag of India image

can you print?
out.println("The object present is " + arrobj.getClass());
out.println("The object present is " + arrobj);
out.println("The object present is " + arrobj.length);
>>session.setAttribute("obj1",obj);
have only one value
so try this arrobj[0]);
 
Avatar of kishan66

ASKER

Hi Gurvinder,

I tried all the Print statements...

--first two throws nothing...empty string though i used simple text like..
 out.println("The object present is " + arrobj.getClass());
 out.println("The object present is " + arrobj);
 
 "I guess there is some problem with " 
Array arrobj = (Array)session.getAttribute("obj1");

--Third print statement
Error-- Variable length at
out.println("The object present is " + arrobj.length);

thanks
>>>>>>Error-- Variable length at
out.println("The object present is " + arrobj.length);

u cant find array length . u can find only size
ASKER CERTIFIED SOLUTION
Avatar of rrz
rrz
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial