Discussions
Categories
Choose a Product
THRUST SERVICES
CORE APPS
CE PRODUCTS
...
Quick Links
POPULAR
HELPFUL TIPS
Groups
My Links
FOR SIGNED IN MEMBERS:
Back to website
Home
Designing Analytics Reports
How to get existing and use existing report connection
Migrateduser
Greeting all,<br />
<br />
I have a need to use an existing report connection to gain access to global temporary tables that are create prior to the report executing. I need the same connection to gain access to the global temp tables so instead of doing a <strong class='bbc'>DataEngine.newDataEngine</strong> which works no GT table access. <br />
<br />
<br />
<strong class='bbc'>to create the db connections create a beforeFactory method with:</strong> <br />
reportContext.getAppContext().put("OdaJDBCDriverPassInConnection", conn);<br />
<br />
<strong class='bbc'>within the beforeFactory event in the report I do:</strong> <br />
var de = reportContext.getAppContext().get("OdaJDBCDriverPassInConnection"); <br />
<br />
<strong class='bbc'>The return value is:</strong><br />
de: |org.jboss.jca.adapters.jdbc.jdk6.WrappedConnectionJDK6@39d2c28a| <br />
<br />
<strong class='bbc'>I then setup the odaDataSource and odaDataSet, </strong><br />
var odaDataSource = new OdaDataSourceDesign( "MyData Source" );<br />
<br />
odaDataSource.setExtensionID( "org.eclipse.birt.report.data.oda.jdbc" );<br />
odaDataSource.addPublicProperty( "odaURL", dsrc.getProperty("odaURL").toString() );<br />
odaDataSource.addPublicProperty( "odaDriverClass", dsrc.getProperty("odaDriverClass").toString());<br />
odaDataSource.addPublicProperty( "odaUser", dsrc.getProperty("odaUser").toString() );<br />
odaDataSource.addPublicProperty( "odaPassword", dsrc.getProperty("odaPassword").toString() ); <br />
<br />
<br />
var odaDataSet = new OdaDataSetDesign( "dsNewDataset" );<br />
odaDataSet.setDataSource( odaDataSource.getName( ) );<br />
odaDataSet.setExtensionID( "org.eclipse.birt.report.data.oda.jdbc.JdbcSelectDataSet" );<br />
strSql = "select * from myGtTable";<br />
odaDataSet.setQueryText( strSql ); <br />
<br />
de.defineDataSet( odaDataSet );<br />
var pq = de.prepare( queryDefinition );<br />
var qr = pq.execute( null );<br />
<br />
<br />
<strong class='bbc'>but when I try to define, prepare and execute them I get the error</strong><br />
<br />
10:50:35 AM EST - Error de.defineDataSet("OdaJDBCDriverPassInConnection") <br />
|Cannot find function defineDataSet in object org.jboss.jca.adapters.jdbc.jdk6.WrappedConnectionJDK6@201044a7.|<br />
10:50:35 AM EST -
<br />
10:50:35 AM EST - Overall Error Catch<br />
10:50:35 AM EST - Error: |Cannot find function printStackTrace in object TypeError: Cannot find function defineDataSet in object org.jboss.jca.adapters.jdbc.jdk6.WrappedConnectionJDK6@201044a7..|<br />
10:50:35 AM EST - <br />
10:50:35 AM EST - beforeFactory -- ENDING --<br />
10:50:35 AM EST - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~<br />
<br />
<br />
<strong class='bbc'>please show me the light</strong><br />
I'm not sure where I am going wrong. If I generate a new connetion from the code below the scripting above works but I don't have access to my GT table. Where am I missing the bus on this issue. If someone can show me the error of my ways I will be greatly be indebit to you.<br />
<br />
var myconfig = reportContext.getReportRunnable().getReportEngine().getConfig();<br />
var de = DataEngine.newDataEngine( myconfig, null );<br />
<br />
<br />
thanks in advance!<br />
Mike W
Find more posts tagged with
Comments
There are no comments yet