Skip to Main Content

Java EE (Java Enterprise Edition) General Discussion

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

can't pass arraylist?

843834Aug 5 2002 — edited Dec 6 2005
I am running my webservice that returns a set of values from a database. It will return a value as a string no problem, so I know it is connecting. It is now giving me a "nullpointerexception" error when I try to print out the first value(or any) in my arraylist. I am assuming it won't pass this type. I tried passing type CachedRowSet and it wouldn't even run, it gave a WSDL parsing error.

Does anyone know how to pass an ArrayList or a CachedRowSet to a client? Or how to populate a ResultSet with more than one value when you have more than one SQL statement bringing info into it? (It was writing over the old value with the new value everytime it went through the loop.)

Here is my server side code to generate the arraylist...
            ResultSet rs = stmt.executeQuery(query);
            int i = 0;
            Object arrayValue;
            while (rs.next()){
                arrayValue = rs.getString("end_phrase");
                returnArray.add(arrayValue);
            
            }         
            conn.close();
            return returnArray;
Here is the client side bringing it in...
resultArray = myProxy.sayHello(rapArray);
            String objectName = (String) resultArray.get(0);
            System.out.println(objectName);          
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jan 3 2006
Added on Aug 5 2002
9 comments
164 views