having acces to two different databases from within Ofbiz

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

having acces to two different databases from within Ofbiz

masionas
Hey,

I wonder what would be the best practice, if there is any, to connect from within Ofbiz to two different datasources, one of which is not Ofbiz-related. Example, I have PostgreSQL DB with ofbiz data model and another PosgreSQL DB with different schema from where I want to read some data preferably using Ofbiz handy entity tools. So what I am looking at is something I could define in entityengine.xml as the second "localpostnew" datasource entry and then have an ability to call either one via delegator?

I would appreciate any ideas. Thanks.
Reply | Threaded
Open this post in threaded view
|

Re: having acces to two different databases from within Ofbiz

masionas
Figured it out.

1) Need to add another data source in entityengine.xml
2) Add <group map > under default delegator  for that data source in entityengine.xml
3) Use delegator.getGroupHelperName  and ConnectionFactory in the code to  obtain the connection

One thing though is you still have to use raw SQLs rather than do queries through OB entity tools.