You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user-java@ibatis.apache.org by Davide Rogora <dr...@unionefiduciaria.it> on 2007/11/26 16:22:14 UTC

Reporting with iBatis

Hi,
I'm developing an intranet web application with iBatis, and I'm very happy
with it :-)

Now, I'm starting to analyze which is the best way to integrate iBatis with
the reporting tool we have chosen (JasperReports).

As JasperReports manual says, a simple a quick way to fill a report is to
execute an SQL query via JDBC and wrap the resulting resultset in an
instance of JRResultSetDataSource. This instance of JRResultSetDataSource is
then passed to the JasperRunManager.runReportToPdfStream() method to export
the report to PDF format and stream it to the browser window.

As alternative, JasperReports could receive a list of beans instead of a
java.sql.resultset object, but I think that for large resultset it could be
a problem to generate a list of 10.000 beans in memory, because of the time
to convert a resultset in a list of objects and because of Out of Memory
problem.

So, my desire would be to have a java.sql.resultset object (instead of a
list of objects or a list of maps) as output of my query, because I think
that is the best and quickly solution for reporting.

Is it possible?
Any other experience on how to integrate iBatis with a reporting tool?

Thanks in advance,
Davide.


R: Reporting with iBatis

Posted by Davide Rogora <dr...@unionefiduciaria.it>.
Larry,
thanks for your reply.

It's a pity that iBatis could not return a java.sql.resultset to be passed
to JasperReports for the following reasons:
1) Now all the sql statements of our application are in sqlmap xml files
2) If we cannot use iBatis for the reports we cannot use the powerful
feature of "Dynamic mapped statements"

Do you think that this feature will be implemented in future versions of
iBatis?
If we add this feature by creating a custom version of iBatis do you think
this will be easy?

Davide.

> Brandon and I had to do this once - we decided it was easier to not
> use iBATIS for 2 reasons.

> The first was what you are describing: it's a pain to get that data
> into Jasper for iBATIS.

> Second, the design tool for Jasper worked better with SQL that other
> data sources.

> As much as iBATIS helps in lots of other cases, it doesn't so much in
> this one. :)

> Larry





Re: Reporting with iBatis

Posted by Larry Meadors <lm...@apache.org>.
Brandon and I had to do this once - we decided it was easier to not
use iBATIS for 2 reasons.

The first was what you are describing: it's a pain to get that data
into Jasper for iBATIS.

Second, the design tool for Jasper worked better with SQL that other
data sources.

As much as iBATIS helps in lots of other cases, it doesn't so much in
this one. :)

Larry


On Nov 26, 2007 8:22 AM, Davide Rogora <dr...@unionefiduciaria.it> wrote:
>
>
> Hi,
> I'm developing an intranet web application with iBatis, and I'm very happy
> with it :-)
>
> Now, I'm starting to analyze which is the best way to integrate iBatis with
> the reporting tool we have chosen (JasperReports).
>
> As JasperReports manual says, a simple a quick way to fill a report is to
> execute an SQL query via JDBC and wrap the resulting resultset in an
> instance of JRResultSetDataSource. This instance of JRResultSetDataSource is
> then passed to the JasperRunManager.runReportToPdfStream() method to export
> the report to PDF format and stream it to the browser window.
>
> As alternative, JasperReports could receive a list of beans instead of a
> java.sql.resultset object, but I think that for large resultset it could be
> a problem to generate a list of 10.000 beans in memory, because of the time
> to convert a resultset in a list of objects and because of Out of Memory
> problem.
>
> So, my desire would be to have a java.sql.resultset object (instead of a
> list of objects or a list of maps) as output of my query, because I think
> that is the best and quickly solution for reporting.
>
> Is it possible?
> Any other experience on how to integrate iBatis with a reporting tool?
>
> Thanks in advance,
> Davide.
>
>