Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Java webservice

 
Akhil kumarS
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Rancher
Pie
Posts: 42967
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Campbell Ritchie
Sheriff
Posts: 48445
56
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
A question which would sit better on a different forum. Moving.
 
Nitin Pathak
Ranch Hand
Posts: 70
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Bartender
Posts: 2968
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please see here why the use of a HashMap should ultimately be avoided.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic