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)
Executing query to database from library datasource
victorba
<p>Hi, </p>
<p> </p>
<p>I'm creating a rptlibrary to share with all the reports in my company. </p>
<p>The library has an oda datasource created and shared to all reports. We want to do some querys from ReportEventAdapter.initialize() to the database to get information from the database. I can acces the datasource in the library in this way:</p>
<p> </p>
<div>
<pre class="_prettyXprint">
ReportDesignHandle rdh = (ReportDesignHandle)reportContext.getReportRunnable().getDesignHandle();
DesignSessionImpl ds = rdh.getModule().getSession();
String rsf = ds.getResourceFolder( );
LibraryHandle libhan = ds.openLibrary(rsf + "/my.rptlibrary" ).handle( );
DataSourceHandle datasource = libhan.findDataSource("myDS");
</pre>
<p>But once I have the datasource, there's no way to get a connection to the database from the datasource. The only way to do this, is creating a classic JDBC connection to the database using the data from the datasource? Is there any way to use a more elegant method to connect to the database from the java handler? Like using pooling, reusing the connection, etc..</p>
<p> </p>
<p>Thanks.</p>
</div>
<p> </p>
Find more posts tagged with
Comments
mwilliams
Have you seen/tried this, by chance?<br><br><a data-ipb='nomediaparse' href='
http://birtworld.blogspot.hk/2007/01/birt-connection-pooling-continued.html'>http://birtworld.blogspot.hk/2007/01/birt-connection-pooling-continued.html</a>
;