I need to call a store procedure in my service, how to do?

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

I need to call a store procedure in my service, how to do?

José Vilmar Estácio de Souza
Hi all.
I am implementing a service and inside the service I need to call a
store procedure.
How can I call the procedure in a simple way?
Thanks.
--
{}S José Vilmar Estácio de Souza

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply | Threaded
Open this post in threaded view
|

RE: I need to call a store procedure in my service, how to do?

netwiser
Here is a simle way for calling Oracle stored procedure.

http://www.craigburke.com/2011/05/13/oracle-stored-procs-in-grails.html

> Date: Fri, 28 Mar 2014 00:55:00 -0300

> From: [hidden email]
> To: [hidden email]
> Subject: [grails-user] I need to call a store procedure in my service, how to do?
>
> Hi all.
> I am implementing a service and inside the service I need to call a
> store procedure.
> How can I call the procedure in a simple way?
> Thanks.
> --
> {}S José Vilmar Estácio de Souza
>
> ---------------------------------------------------------------------
> To unsubscribe from this list, please visit:
>
> http://xircles.codehaus.org/manage_email
>
>
Reply | Threaded
Open this post in threaded view
|

Re: I need to call a store procedure in my service, how to do?

sergiomichels
If you want to separate this logic from your services, try this plugin: http://grails.org/plugin/dao-artefacts

--
Sérgio Michels


On Fri, Mar 28, 2014 at 9:58 AM, James Zhang <[hidden email]> wrote:
Here is a simle way for calling Oracle stored procedure.

http://www.craigburke.com/2011/05/13/oracle-stored-procs-in-grails.html

> Date: Fri, 28 Mar 2014 00:55:00 -0300
> From: [hidden email]
> To: [hidden email]
> Subject: [grails-user] I need to call a store procedure in my service, how to do?

>
> Hi all.
> I am implementing a service and inside the service I need to call a
> store procedure.
> How can I call the procedure in a simple way?
> Thanks.
> --
> {}S José Vilmar Estácio de Souza
>
> ---------------------------------------------------------------------
> To unsubscribe from this list, please visit:
>
> http://xircles.codehaus.org/manage_email
>
>

Reply | Threaded
Open this post in threaded view
|

Re: I need to call a store procedure in my service, how to do?

Jeff Scott Brown-2
In reply to this post by José Vilmar Estácio de Souza


On March 27, 2014 at 10:56:53 PM, José Vilmar Estácio de Souza ([hidden email]) wrote:
> Hi all.
> I am implementing a service and inside the service I need to call a
> store procedure.
> How can I call the procedure in a simple way?
> Thanks.
>

There is a bean in the application context named dataSource and that bean is the default DataSource instance that is associated with your database connection.  A simple thing to do is to have that bean injected into your service and then interact with it as you would in any Groovy app.  There is nothing really Grails specific about it after the DI is done.

Often when folks ask about this what they are really asking is if GORM provides some query methods accessing stored procedures and the answer is no.




JSB
--
Jeff Scott Brown
[hidden email]

Autism Strikes 1 in 166  
Find The Cause ~ Find The Cure
http://www.autismspeaks.org/



---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email