Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
THRUST SERVICES & TOOLS
CLOUD EDITIONS
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Intelligence (Analytics)
Storing JDBC strings in JNDI / Selecting programatically
elmatador
Hi all,
Been lurking on these forums for about 6 months now but can't find an answer to this one here already, so here goes!
I've authored several BIRT reports as part of a Java web-app, which I've installed in several environments: A development environment, two testing environments and a pre-production environment. Each environment has its own database.
It's quite irritating that I need to manually amend the JDBC string within the Data Source for every report, every time I deploy the reports to a different environment. There are quite a few and it takes quite a while!
Does anyone know if it is possible to perhaps store each JDBC string in a Directory Service such as LDAP, and use a combination of JNDI and BIRTs API's to identify the name of the environment from the URL, and then use this name to retrieve the relevant JDBC from a Naming Service, then set the JDBC string to the one retrieved?
I just figure this would save on having to edit the JDBC string for each report when it is deployed to every environment. It'd make the reports environment independent!
Naturally if there are any sources or tutorials elsewhere that you'd be kind enough to redirect me to, I'm more than happy to read them and attempt the feat myself!
Thanks!
Find more posts tagged with
Comments
bhanley
Have a look at this Wiki entry. It talks about binding your data source info to dynamic parameters.<br />
<br />
<a class='bbc_url' href='
http://www.birt-exchange.com/wiki/BIRT:Report_Parameters/#Q:__Can_I_Bind_my_Data_Source_Connection_Properties_to_Parameters.3F'>BIRT:Report
Parameters - BIRT Wiki - BIRT Exchange</a>
elmatador
Thanks bhanley. Looks like I can use this approach to change the JDBC string at run-time. I was looking for some BIRT API for this purpose, but this approach suits me fine.
I expect the retrieval from JDNI is simple enough - import the JNDI packages and write the script to run at run-time and set the report parameter with the JDBC string which is retrieved.
Thanks for your help!