Greeting all,
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 DataEngine.newDataEngine which works no GT table access.
to create the db connections create a beforeFactory method with:
reportContext.getAppContext().put("OdaJDBCDriverPassInConnection", conn);
within the beforeFactory event in the report I do:
var de = reportContext.getAppContext().get("OdaJDBCDriverPassInConnection");
The return value is:
de: |org.jboss.jca.adapters.jdbc.jdk6.WrappedConnectionJDK6@39d2c28a|
I then setup the odaDataSource and odaDataSet,
var odaDataSource = new OdaDataSourceDesign( "MyData Source" );
odaDataSource.setExtensionID( "org.eclipse.birt.report.data.oda.jdbc" );
odaDataSource.addPublicProperty( "odaURL", dsrc.getProperty("odaURL").toString() );
odaDataSource.addPublicProperty( "odaDriverClass", dsrc.getProperty("odaDriverClass").toString());
odaDataSource.addPublicProperty( "odaUser", dsrc.getProperty("odaUser").toString() );
odaDataSource.addPublicProperty( "odaPassword", dsrc.getProperty("odaPassword").toString() );
var odaDataSet = new OdaDataSetDesign( "dsNewDataset" );
odaDataSet.setDataSource( odaDataSource.getName( ) );
odaDataSet.setExtensionID( "org.eclipse.birt.report.data.oda.jdbc.JdbcSelectDataSet" );
strSql = "select * from myGtTable";
odaDataSet.setQueryText( strSql );
de.defineDataSet( odaDataSet );
var pq = de.prepare( queryDefinition );
var qr = pq.execute( null );
but when I try to define, prepare and execute them I get the error
10:50:35 AM EST - Error de.defineDataSet("OdaJDBCDriverPassInConnection")
|Cannot find function defineDataSet in object org.jboss.jca.adapters.jdbc.jdk6.WrappedConnectionJDK6@201044a7.|
10:50:35 AM EST - ----------------------------------------------------
10:50:35 AM EST - Overall Error Catch
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..|
10:50:35 AM EST -
10:50:35 AM EST - beforeFactory -- ENDING --
10:50:35 AM EST - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
please show me the light
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.
var myconfig = reportContext.getReportRunnable().getReportEngine().getConfig();
var de = DataEngine.newDataEngine( myconfig, null );
thanks in advance!
Mike W
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 DataEngine.newDataEngine which works no GT table access.
to create the db connections create a beforeFactory method with:
reportContext.getAppContext().put("OdaJDBCDriverPassInConnection", conn);
within the beforeFactory event in the report I do:
var de = reportContext.getAppContext().get("OdaJDBCDriverPassInConnection");
The return value is:
de: |org.jboss.jca.adapters.jdbc.jdk6.WrappedConnectionJDK6@39d2c28a|
I then setup the odaDataSource and odaDataSet,
var odaDataSource = new OdaDataSourceDesign( "MyData Source" );
odaDataSource.setExtensionID( "org.eclipse.birt.report.data.oda.jdbc" );
odaDataSource.addPublicProperty( "odaURL", dsrc.getProperty("odaURL").toString() );
odaDataSource.addPublicProperty( "odaDriverClass", dsrc.getProperty("odaDriverClass").toString());
odaDataSource.addPublicProperty( "odaUser", dsrc.getProperty("odaUser").toString() );
odaDataSource.addPublicProperty( "odaPassword", dsrc.getProperty("odaPassword").toString() );
var odaDataSet = new OdaDataSetDesign( "dsNewDataset" );
odaDataSet.setDataSource( odaDataSource.getName( ) );
odaDataSet.setExtensionID( "org.eclipse.birt.report.data.oda.jdbc.JdbcSelectDataSet" );
strSql = "select * from myGtTable";
odaDataSet.setQueryText( strSql );
de.defineDataSet( odaDataSet );
var pq = de.prepare( queryDefinition );
var qr = pq.execute( null );
but when I try to define, prepare and execute them I get the error
10:50:35 AM EST - Error de.defineDataSet("OdaJDBCDriverPassInConnection")
|Cannot find function defineDataSet in object org.jboss.jca.adapters.jdbc.jdk6.WrappedConnectionJDK6@201044a7.|
10:50:35 AM EST - ----------------------------------------------------
10:50:35 AM EST - Overall Error Catch
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..|
10:50:35 AM EST -
10:50:35 AM EST - beforeFactory -- ENDING --
10:50:35 AM EST - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
please show me the light
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.
var myconfig = reportContext.getReportRunnable().getReportEngine().getConfig();
var de = DataEngine.newDataEngine( myconfig, null );
thanks in advance!
Mike W