You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@axis.apache.org by Gregory G Carter <gc...@aesgi.com> on 2005/03/18 18:38:37 UTC

JDBC Service

Hello,

   I have Axis up and running, and have done some examples but I am 
really interested to know how I can return a JDBC result set from a web 
service, and what exactly is involved in the client end.

  Has anyone attempted to obtain result sets of JDBC queries from a web 
service?

-gc

Re: JDBC Service

Posted by Axel Burwitz <ax...@arcor.de>.
Gregory G Carter wrote:
> Hello,
> 
>   I have Axis up and running, and have done some examples but I am 
> really interested to know how I can return a JDBC result set from a web 
> service, and what exactly is involved in the client end.
> 
>  Has anyone attempted to obtain result sets of JDBC queries from a web 
> service?
> 
> -gc
> 

Hi,

I have implemented a web service which updates and selects values from a 
MySQL database, and executes the transport to a client via Axis/SOAP.

In the web service are "prepared statements" with the variables in the 
prepared statement are filled from / stored into an int[] array which is 
transported between client pc and server (Tomcat/Axis/MySQL).

Needed a lot of trying and testing, because there is no comprehensive 
How To (if you discover one, lease let me know..)

rgds
Axel


Re: JDBC Service

Posted by Anne Thomas Manes <at...@gmail.com>.
And to answer your second question, you should retrun an array of
objects. May the table row structure to a JavaBean and return an array
of the bean.

Anne


On Fri, 18 Mar 2005 19:19:57 +0100, Ephemeris Lappis
<ep...@gmail.com> wrote:
> I don't think a single solution exists. For example, you can call a first
> method of your service to obtain only the entities identifiers, and then,
> using some kind of paging logic, call another method to get parts of your
> results for a subset of the keys. I also use similar tricks to handle big
> data from remote ejbs.
> 
> --
> Ephemeris Lappis
> 
> >>> -----Message d'origine-----
> >>> De : Gregory G Carter [mailto:gcarter@aesgi.com]
> >>> Envoyé : vendredi 18 mars 2005 19:14
> >>> À : axis-user@ws.apache.org
> >>> Objet : Re: JDBC Service
> >>>
> >>>
> >>> I guess I also have some more questions:
> >>>
> >>> If I issue a request to an object on the AXIS server to query a remote
> >>> database, what do I do with large queries?  For example, if the query
> >>> set is large, I have to buffer it at the server before I send it off to
> >>> the client.
> >>>
> >>> Is there a accepted best practice for handling large soap messages at
> >>> the client end logic?
> >>>
> >>> What data type should I use for storing and forwarding the query?
> >>>
> >>> Should I use a straight string, byte [] array...???
> >>>
> >>> I am not too familair at the moment with what data types are best used
> >>> for SOAP messaging and the implications of those types on the size of
> >>> the messages.
> >>>
> >>> Any suggestions would be appreciated.
> >>>
> >>> Thanks...
> >>>
> >>> -gc
> >>>
> >>> Ephemeris Lappis wrote:
> >>>
> >>> >You should design objects that map your data, and return an
> >>> array of them.
> >>> >In my opinion, to respect a good design principle, your
> >>> web-service should
> >>> >call some kind of 'business service', and only this service
> >>> should be aware
> >>> >of your data representation in the database, directly (using sql), or
> >>> >through a data mapping layer (tool or ejb entities). I
> >>> generally build my
> >>> >web services as a j2ee endpoint ejb, over another internal
> >>> business ejb that
> >>> >handles data.
> >>> >It's just my opinion...
> >>> >
> >>> >--
> >>> >Ephemeris Lappis
> >>> >
> >>> >
> >>> >
> >>> >>>>-----Message d'origine-----
> >>> >>>>De : Gregory G Carter [mailto:gcarter@aesgi.com]
> >>> >>>>Envoyé : vendredi 18 mars 2005 18:39
> >>> >>>>À : axis-user@ws.apache.org
> >>> >>>>Objet : JDBC Service
> >>> >>>>
> >>> >>>>
> >>> >>>>Hello,
> >>> >>>>
> >>> >>>>   I have Axis up and running, and have done some examples but I am
> >>> >>>>really interested to know how I can return a JDBC result
> >>> set from a web
> >>> >>>>service, and what exactly is involved in the client end.
> >>> >>>>
> >>> >>>>  Has anyone attempted to obtain result sets of JDBC
> >>> queries from a web
> >>> >>>>service?
> >>> >>>>
> >>> >>>>-gc
> >>> >>>>
> >>> >>>>
> >>> >
> >>> >.
> >>> >
> >>> >
> >>> >
> >>>
> 
>

RE: JDBC Service

Posted by Ephemeris Lappis <ep...@gmail.com>.
I don't think a single solution exists. For example, you can call a first
method of your service to obtain only the entities identifiers, and then,
using some kind of paging logic, call another method to get parts of your
results for a subset of the keys. I also use similar tricks to handle big
data from remote ejbs.

--
Ephemeris Lappis

>>> -----Message d'origine-----
>>> De : Gregory G Carter [mailto:gcarter@aesgi.com]
>>> Envoyé : vendredi 18 mars 2005 19:14
>>> À : axis-user@ws.apache.org
>>> Objet : Re: JDBC Service
>>>
>>>
>>> I guess I also have some more questions:
>>>
>>> If I issue a request to an object on the AXIS server to query a remote
>>> database, what do I do with large queries?  For example, if the query
>>> set is large, I have to buffer it at the server before I send it off to
>>> the client.
>>>
>>> Is there a accepted best practice for handling large soap messages at
>>> the client end logic?
>>>
>>> What data type should I use for storing and forwarding the query?
>>>
>>> Should I use a straight string, byte [] array...???
>>>
>>> I am not too familair at the moment with what data types are best used
>>> for SOAP messaging and the implications of those types on the size of
>>> the messages.
>>>
>>> Any suggestions would be appreciated.
>>>
>>> Thanks...
>>>
>>> -gc
>>>
>>> Ephemeris Lappis wrote:
>>>
>>> >You should design objects that map your data, and return an
>>> array of them.
>>> >In my opinion, to respect a good design principle, your
>>> web-service should
>>> >call some kind of 'business service', and only this service
>>> should be aware
>>> >of your data representation in the database, directly (using sql), or
>>> >through a data mapping layer (tool or ejb entities). I
>>> generally build my
>>> >web services as a j2ee endpoint ejb, over another internal
>>> business ejb that
>>> >handles data.
>>> >It's just my opinion...
>>> >
>>> >--
>>> >Ephemeris Lappis
>>> >
>>> >
>>> >
>>> >>>>-----Message d'origine-----
>>> >>>>De : Gregory G Carter [mailto:gcarter@aesgi.com]
>>> >>>>Envoyé : vendredi 18 mars 2005 18:39
>>> >>>>À : axis-user@ws.apache.org
>>> >>>>Objet : JDBC Service
>>> >>>>
>>> >>>>
>>> >>>>Hello,
>>> >>>>
>>> >>>>   I have Axis up and running, and have done some examples but I am
>>> >>>>really interested to know how I can return a JDBC result
>>> set from a web
>>> >>>>service, and what exactly is involved in the client end.
>>> >>>>
>>> >>>>  Has anyone attempted to obtain result sets of JDBC
>>> queries from a web
>>> >>>>service?
>>> >>>>
>>> >>>>-gc
>>> >>>>
>>> >>>>
>>> >
>>> >.
>>> >
>>> >
>>> >
>>>


Re: JDBC Service

Posted by Gregory G Carter <gc...@aesgi.com>.
I guess I also have some more questions:

If I issue a request to an object on the AXIS server to query a remote 
database, what do I do with large queries?  For example, if the query 
set is large, I have to buffer it at the server before I send it off to 
the client.

Is there a accepted best practice for handling large soap messages at 
the client end logic?

What data type should I use for storing and forwarding the query?

Should I use a straight string, byte [] array...???

I am not too familair at the moment with what data types are best used 
for SOAP messaging and the implications of those types on the size of 
the messages.

Any suggestions would be appreciated.

Thanks...

-gc

Ephemeris Lappis wrote:

>You should design objects that map your data, and return an array of them.
>In my opinion, to respect a good design principle, your web-service should
>call some kind of 'business service', and only this service should be aware
>of your data representation in the database, directly (using sql), or
>through a data mapping layer (tool or ejb entities). I generally build my
>web services as a j2ee endpoint ejb, over another internal business ejb that
>handles data.
>It's just my opinion...
>
>--
>Ephemeris Lappis
>
>  
>
>>>>-----Message d'origine-----
>>>>De : Gregory G Carter [mailto:gcarter@aesgi.com]
>>>>Envoyé : vendredi 18 mars 2005 18:39
>>>>À : axis-user@ws.apache.org
>>>>Objet : JDBC Service
>>>>
>>>>
>>>>Hello,
>>>>
>>>>   I have Axis up and running, and have done some examples but I am
>>>>really interested to know how I can return a JDBC result set from a web
>>>>service, and what exactly is involved in the client end.
>>>>
>>>>  Has anyone attempted to obtain result sets of JDBC queries from a web
>>>>service?
>>>>
>>>>-gc
>>>>        
>>>>
>
>.
>
>  
>


RE: JDBC Service

Posted by Ephemeris Lappis <ep...@gmail.com>.
You should design objects that map your data, and return an array of them.
In my opinion, to respect a good design principle, your web-service should
call some kind of 'business service', and only this service should be aware
of your data representation in the database, directly (using sql), or
through a data mapping layer (tool or ejb entities). I generally build my
web services as a j2ee endpoint ejb, over another internal business ejb that
handles data.
It's just my opinion...

--
Ephemeris Lappis

>>> -----Message d'origine-----
>>> De : Gregory G Carter [mailto:gcarter@aesgi.com]
>>> Envoyé : vendredi 18 mars 2005 18:39
>>> À : axis-user@ws.apache.org
>>> Objet : JDBC Service
>>>
>>>
>>> Hello,
>>>
>>>    I have Axis up and running, and have done some examples but I am
>>> really interested to know how I can return a JDBC result set from a web
>>> service, and what exactly is involved in the client end.
>>>
>>>   Has anyone attempted to obtain result sets of JDBC queries from a web
>>> service?
>>>
>>> -gc