Re: Cayenne+jasper reports

2014-10-31 Thread René Aravena
Thanks for the help friends. El 31/10/2014 01:37, "Andrus Adamchik" escribió: > > > ((DataContext)getObjectContext()).getParentDataDomain().getDefaultNode().getDataSource().getConnection(); > > > There is a shortcut in 3.1 for the code above: > > ServerRuntime runtime = .. > DataSource ds = r

Re: Cayenne+jasper reports

2014-10-30 Thread Andrus Adamchik
> ((DataContext)getObjectContext()).getParentDataDomain().getDefaultNode().getDataSource().getConnection(); There is a shortcut in 3.1 for the code above: ServerRuntime runtime = .. DataSource ds = runtime.getDataSource("mynode"); JNDI mentioned by Ari is an even better alternative. Andrus

Re: Cayenne+jasper reports

2014-10-30 Thread Aristedes Maniatis
For many projects you'll put the database connection details into JNDI and have Cayenne and anything else get it from there. Of course you might like to give Jasper a read-only connection. Alternatively we wrote a layer which has Jasper access the data model through Cayenne. A bit of work, but

Re: Cayenne+jasper reports

2014-10-30 Thread Markus Reich
Hi René, yes you can access a connection e.g. public static Connection getConnection() throws Exception { return ((DataContext)getObjectContext()).getParentDataDomain().getDefaultNode().getDataSource().getConnection(); } 2014-10-31 3:30 GMT+01:00 René Aravena : > With cayenne 3.1, as I ca

Cayenne+jasper reports

2014-10-30 Thread René Aravena
With cayenne 3.1, as I can get the connection to the database to pass it to jasperreports? René