You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@cayenne.apache.org by Malcolm Edgar <ma...@gmail.com> on 2006/10/20 03:35:38 UTC
Get Connection
Hi All,
I am using a Jasper reports in a Cayenne project, and I want to obtain
a Connection from Cayenne for Japser to use.
I am finding the following code does not work as the Configuration
object is returning a null DataSourceFactory:
Configuration configuration = Configuration.getSharedConfiguration();
String domainName = getDataContext().getParentDataDomain().getName();
configuration.getDataSourceFactory().getDataSource(domainName);
What is the proper approach for this?
regards Malcolm Edgar
Re: Get Connection
Posted by Tore Halset <ha...@pvv.ntnu.no>.
On Oct 20, 2006, at 13:24, Tore Halset wrote:
> On Oct 20, 2006, at 3:35, Malcolm Edgar wrote:
>
>> I am using a Jasper reports in a Cayenne project, and I want to
>> obtain
>> a Connection from Cayenne for Japser to use.
>
> I am doing something like this:
>
> DataDomain domain = Configuration.getSharedConfiguration().getDomain
> ();
> DataNode node = domain.getNode(nodename);
> Connection conn = node.getDataSource().getConnection();
Make sure you see this one as well
http://cwiki.apache.org/confluence/display/CAY/Jasper+Integration
- Tore.
Re: Get Connection
Posted by Tore Halset <ha...@pvv.ntnu.no>.
On Oct 20, 2006, at 3:35, Malcolm Edgar wrote:
> I am using a Jasper reports in a Cayenne project, and I want to obtain
> a Connection from Cayenne for Japser to use.
I am doing something like this:
DataDomain domain = Configuration.getSharedConfiguration().getDomain();
DataNode node = domain.getNode(nodename);
Connection conn = node.getDataSource().getConnection();
- Tore.