Quantcast

using different database schemas

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

using different database schemas

Herrera
Hi,
   
   In my dataSource I´ve been using  the  default_schema tag. I need to get information  from another table from different schema.

How I do this ? Where do I set this information for the table that I need ?


Herrera
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: using different database schemas

Erick Erickson
Somewhere back in the mail archive there's a thread about multiple
dataSources that might help. Sorry but I don't have it at my fingertips.

You could always just use Groovy SQL, providing your own credentials
rather than using GORM, depending upon your needs.

Best
Erick

On Fri, Dec 12, 2008 at 4:53 AM, Pedro Herrera <[hidden email]> wrote:

Hi,

  In my dataSource I´ve been using  the  default_schema tag. I need to get
information  from another table from different schema.

How I do this ? Where do I set this information for the table that I need ?


Herrera
--
View this message in context: http://www.nabble.com/using-different-database-schemas-tp20971603p20971603.html
Sent from the grails - user mailing list archive at Nabble.com.


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

   http://xircles.codehaus.org/manage_email



Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: using different database schemas

Herrera
How  do I do this ?

I´ve seen an example :

import groovy.sql.Sql
sql = Sql.newInstance("jdbc:jtds:sqlserver://serverName/dbName-CLASS;domain=domainName", "username",
                     "password", "net.sourceforge.jtds.jdbc.Driver")
sql.eachRow("select * from tableName", { println it.id + " -- ${it.firstName} --"} );

but in my case I use same datasource.

Herrera




Erick Erickson wrote
Somewhere back in the mail archive there's a thread about multiple
dataSources that might help. Sorry but I don't have it at my fingertips.

You could always just use Groovy SQL, providing your own credentials
rather than using GORM, depending upon your needs.

Best
Erick

On Fri, Dec 12, 2008 at 4:53 AM, Pedro Herrera <pedro_herrera@hotmail.com>wrote:

>
> Hi,
>
>   In my dataSource I´ve been using  the  default_schema tag. I need to get
> information  from another table from different schema.
>
> How I do this ? Where do I set this information for the table that I need ?
>
>
> Herrera
> --
> View this message in context:
> http://www.nabble.com/using-different-database-schemas-tp20971603p20971603.html
> Sent from the grails - user mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe from this list, please visit:
>
>    http://xircles.codehaus.org/manage_email
>
>
>
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: using different database schemas

ladislao
In reply to this post by Herrera
Maybe, you could use plugin call datasources, i use in my grails with mysql,sqlserver and oracle, its excellent, link  is http://burtbeckwith.com/blog/?p=70

i hope this help you as me


Pedro Herrera wrote
Hi,
   
   In my dataSource I´ve been using  the  default_schema tag. I need to get information  from another table from different schema.

How I do this ? Where do I set this information for the table that I need ?


Herrera
Loading...