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)
why datesets cannot bind script dataSource
kevin23_hy
The situation is that i would like to reuse dataSource,so to create public library contains a common dataSource and then a .reportdesign reference it; that .reportdesign has a dateset for jdbc query but cannot be binded and throw a type not matched exception,pls why?<br />
there is a dataSource scriplet as follow:<br />
<pre class='_prettyXprint _lang-auto _linenums:0'>
importPackage( Packages.java.io,Packages.java.util);
importPackage( Packages.javax.servlet.http );
req = reportContext.getHttpServletRequest( );
propPath = new String("BirtConfig.properties"); //BirtConfig.properties has oracle connection properties
if ( propPath.charAt(0) != "/" )
propPath = "/" + propPath;
url = req.getSession( ).getServletContext( ).getResource( propPath );
if ( url != null )[attachment=4098:DS_exception.jpg]
{
props = new java.util.Properties( );
props.load( url.openStream( ) );
extensionProperties.odaURL = new String(props.getProperty("url"));
extensionProperties.odaDriverClass = new String(props.getProperty("driver"));
extensionProperties.odaUser = new String(props.getProperty("userid"));
extensionProperties.odaPassword = new String(props.getProperty("password"));
}
</pre>
<br />
application container is Tomcat6.x,birt version is 2.5.2,<br />
appreciated for reply.
Find more posts tagged with
Comments
mwilliams
Hi kevin23_hy,
So, you're trying to use a scripted dataSource with a SQL Query dataSet?
kevin23_hy
yes,man.
i want to know how to load jdbc configuration from the property file in web container using by script dataSource of birt designer.
so the code above is correct or some wrong,pls correct me.