This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Web Services and the fly likes Java webservice Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Web Services
Bookmark "Java webservice" Watch "Java webservice" New topic

Java webservice

Akhil kumarS

Joined: Oct 16, 2007
Posts: 13
Is it possible to return a result set from a java webservice? If possible show me some codes. If it is not possible how can i get the result set values from webservice??
Ulf Dittmer

Joined: Mar 22, 2005
Posts: 41065
By "result set", do you mean an instance of java.sql.ResultSet? If so, the answer is no. Web services should be implemented in a platform-neutral way, and not return objects that tie you into one particular language. Use arrays instead.

Ping & DNS - my free Android networking tools app
Campbell Ritchie

Joined: Oct 13, 2005
Posts: 37926
A question which would sit better on a different forum. Moving.
Nitin Pathak
Ranch Hand

Joined: Sep 25, 2006
Posts: 70
If the iterating over java.sql.ResultSet processed different data types, Intergers and String, use a HashMap (typecast in to Integer wrapper):

The server side can be coded in the following way:

The client side implementation can be described as:

Hope this helps!
[ December 16, 2008: Message edited by: Nitin Pathak ]
Peer Reynders

Joined: Aug 19, 2005
Posts: 2921
Please see here why the use of a HashMap should ultimately be avoided.
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
subject: Java webservice
Similar Threads
getting ResultSet from Java Stored Procedure
Setting time out for web service call
accessing web service through a jsp/html
Java webservice
JNI in webserivices - Is it possible ?