Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » BIRT » use jndi with connection profile ?(I need a way to be independant of target DB)
use jndi with connection profile ? [message #684521] Wed, 15 June 2011 18:02 Go to next message
Cyril Rognon is currently offline Cyril RognonFriend
Messages: 24
Registered: July 2010
Junior Member
Hello all,

I am using Birt with connection profile. On the design time, everything works really fine. Very Happy

Then my design is under windows and I deploy to linux.

troubles begin when I want to use my connection profile : it encloses a jarlist property that is tied to my design environement. The driver is not found even if it is in the lib directory of tomcat.

On design I use a jdbc/profile connection.
On my target Tomcat system ther is a jndi datasource. How can I use this ?

Could I use a connection profile on design environement and a jndi DS on the target environement ?



Thanks
Cyril
(no subject) [message #684553 is a reply to message #684521] Wed, 15 June 2011 19:25 Go to previous messageGo to next message
Jason Weathersby is currently offline Jason WeathersbyFriend
Messages: 9167
Registered: July 2009
Senior Member

You can change the connection profile dynamically either through
property binding or script. For example say you put a connection
profile in the resource folder of your deployment. You could add a
beforeOpen script to set the connection profile like:

if(
!reportContext.getHttpServletRequest().getAttribute("attributeBean").isDesigner()
){
myresourcefolder = reportContext.getDesignHandle().getResourceFolder()
this.setExtensionProperty("OdaConnProfileStorePath",
myresourcefolder+"/mysqlclassic.txt");
}

On 6/15/2011 2:02 PM, Cyril Rognon wrote:
> Hello all,
>
> I am using Birt with connection profile. On the design time, everything
> works really fine. :d
> Then my design is under windows and I deploy to linux.
>
> troubles begin when I want to use my connection profile : it encloses a
> jarlist property that is tied to my design environement. The driver is
> not found even if it is in the lib directory of tomcat.
>
> On design I use a jdbc/profile connection.
> On my target Tomcat system ther is a jndi datasource. How can I use this ?
>
> Could I use a connection profile on design environement and a jndi DS on
> the target environement ?
>
>
>
> Thanks
> Cyril
icon14.gif  Re: (no subject) [message #684754 is a reply to message #684553] Thu, 16 June 2011 07:27 Go to previous messageGo to next message
Cyril Rognon is currently offline Cyril RognonFriend
Messages: 24
Registered: July 2010
Junior Member
Hello jason,

thx for your quick answer as always.

I did use another trick that is close to your solution : the connection profile store URL property bindind.

there I have this expression : reportContext.getAppContext().get("birt.viewer.resource.path") +"/mypath/mydb.store"

do you think before open might be a better place ?

this way I have mydb.store file on dev and production that are different.

now I am looking for documentation in order to use a jndi datasource in a connection profile... when I use birt/dtp tools it seems I cannot provide a sole jndi name. it requires db url, drivers, etc...
Can anyone point me to a valuable ressource on this matter ?

regards
Cyril
Re: (no subject) [message #684926 is a reply to message #684754] Thu, 16 June 2011 13:37 Go to previous message
Jason Weathersby is currently offline Jason WeathersbyFriend
Messages: 9167
Registered: July 2009
Senior Member

That is fine. On jndi I believe that dburl, etc are used only if the
jndi connection fails.

Jason

On 6/16/2011 3:27 AM, Cyril Rognon wrote:
> Hello jason,
>
> thx for your quick answer as always.
>
> I did use another trick that is close to your solution : the connection
> profile store URL property bindind.
>
> there I have this expression :
> reportContext.getAppContext().get("birt.viewer.resource.path")
> +"/mypath/mydb.store"
>
> do you think before open might be a better place ?
>
> this way I have mydb.store file on dev and production that are different.
>
> now I am looking for documentation in order to use a jndi datasource in
> a connection profile... when I use birt/dtp tools it seems I cannot
> provide a sole jndi name. it requires db url, drivers, etc...
> Can anyone point me to a valuable ressource on this matter ?
>
> regards
> Cyril
Previous Topic:Use output of a dataset into another dataset
Next Topic:(no subject)
Goto Forum:
  


Current Time: Fri Dec 19 21:45:31 GMT 2014

Powered by FUDForum. Page generated in 0.01569 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software