Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
PUBLIC CLOUD
PRIVATE CLOUD
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Intelligence (Analytics)
Set DataSource at runtime
dominik
Hi there,
I've read a lot according to this subject, but I was not able to find a solution.
How can I pass the application-DataSource configured in Websphere from my application code to the birt-runtime executing the report-generation?
The point is that I'm already able to pass some parameters to my rptdesign but on the life-system I'm not allowed to know the DB-User and its Password!
This is what I'm currently doing:
IRunAndRenderTask task = engine.createRunAndRenderTask(design); ...
task.setParameterValue("JDBCDriverURL", "jdbc:db2://blablabla...");
task.setParameterValue("UserName", "un");
task.setParameterValue("Password", "pw");
...
That's what I'm looking for:
task/options/whatever.setDataSource(dataSource);
I'm sure I'm not the only one who wants to do s.th. like that...so please give me a hint ;-)
Thanks & Regards
Dominik
Find more posts tagged with
Comments
JasonW
Can you get access to the connection object? If so take a look at this post:<br />
<a class='bbc_url' href='
http://birtworld.blogspot.com/2008/11/birt-connection-pooling-continued-again.html'>BIRT
World: BIRT Connection Pooling Continued Again</a><br />
<br />
Alternatively, BIRT supports JNDI URL to look up a connection from the app server. You can also use connection profiles, where the encrypted connection profile is stored in a file that can be changed between dev and deployment.
dominik
Thanks - it works!
The solution was as simple as my idea in pseudocode:
task.getAppContext().put("OdaJDBCDriverPassInConnection", ds.getConnection());
Could you tell me where this is documented? Maybe there are some other valuable hints for the future!? It's always exhausting to search in fragmented sources like Blogs or Forums?
JasonW
I need to get it on the website, but currently only have it on the blog.