Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » BIRT » how to define as data source a passed jdbc connection
how to define as data source a passed jdbc connection [message #484392] Mon, 07 September 2009 07:19 Go to next message
Diana Mising name is currently offline Diana Mising name
Messages: 34
Registered: July 2009
Member
Hi

I am very new to BIRT and I want to create a sort of "hello world" report.
I'm trying to see how difficult it would be to switch our company's
reporting app from jasper to BIRT.

I have seen the tutorials and all seems great, until I realized I have to
pass the jdbc connection from my app to the report. So in my code I set:

task.getAppContext().put("OdaJDBCDriverPassInConnection", conn);

but then how do I define the data source in the report designer? I imagine
it would have to be a scripted data source, but the given examples suggest
that a scripted data source is a completely different thing.

So - how can I use the connection that I set in the IRunAndRenderTask task?
Re: how to define as data source a passed jdbc connection [message #484555 is a reply to message #484392] Tue, 08 September 2009 04:36 Go to previous messageGo to next message
John Missing name is currently offline John Missing name
Messages: 513
Registered: July 2009
Senior Member
In report designer use the standard "jdbc datasource" und "jdbc dataset".

In your app first call
task.getAppContext().put("OdaJDBCDriverPassInConnection", conn);
and then
"runAndRender()"
your connection "conn" is used instead of the connection and/or datasource you defined directly in your rptdesign-file.

There's a bug in birt 2.5 that you cannot use OdaJDBCDriverPassInConnection with crosstab reports.

Scripted data source is completley different - we use it to pass in java objects from our apps to birt.

John

Diana Pop schrieb:
> Hi
>
> I am very new to BIRT and I want to create a sort of "hello world"
> report. I'm trying to see how difficult it would be to switch our
> company's reporting app from jasper to BIRT.
>
> I have seen the tutorials and all seems great, until I realized I have
> to pass the jdbc connection from my app to the report. So in my code I set:
>
> task.getAppContext().put("OdaJDBCDriverPassInConnection", conn);
>
> but then how do I define the data source in the report designer? I
> imagine it would have to be a scripted data source, but the given
> examples suggest that a scripted data source is a completely different
> thing.
>
> So - how can I use the connection that I set in the IRunAndRenderTask task?
>
Re: how to define as data source a passed jdbc connection [message #484596 is a reply to message #484555] Tue, 08 September 2009 08:54 Go to previous message
Diana Mising name is currently offline Diana Mising name
Messages: 34
Registered: July 2009
Member
thank you !!
Previous Topic:ClassNotFoundException: oracle.jdbc.driver.OracleDriver
Next Topic:Performance problem
Goto Forum:
  


Current Time: Mon Sep 01 19:36:55 EDT 2014

Powered by FUDForum. Page generated in 0.06437 seconds