MyTop is cool

I was reading High Perfomance Mysql and in that book they mention a tool called Mytop basically it is a top clone for Mysql. Instead of running show full processlist; repetedly on the mysql console just run mytop. Helps you quite a bit.

I had an installing it. I get the foll error

Can’t locate Term/ReadKey.pm in @INC (@INC contains: /usr/lib/perl5/5.6.1/i386-linux /usr/lib/perl5/5.6.1 /usr/lib/perl5/site_perl/5.6.1/i386-linux

This is because it requires TermReadKey Perl Package. Just run

yum install perl-TermReadKey

and you are ready to go.

Jasper Reports: Java Beans as DataSource for Subreports

Today I had a problem. I had a complex bean (Bean which contained other beans) which was being sent as JRBeanCollectionDataSource (JasperReports API version 2.0.2) to a Jasper Report.
This report had to have sub reports for the inner bean. I really could not find out how to pass the bean to the subreport from my main report.
Finally I cracked the nut.
What I did was set the DataSourceExpression in the Subreport element to

<datasourceexpression>
<!–[CDATA[new net.sf.jasperreports.engine.data.JRBeanCollectionDataSource($F{taxBeanList})]]–\>
</datasourceexpression>

Where $F{taxBeanList} is a collection of Tax Beans.
In My subreport I do not have any datasource or queires. This sort of got it working.
I hope to add more to this post in future when I reread it and find some gaps.

Outer Joins Vs Inner Joins

Today I looked into Outer Joins and Inner Joins. I have never used joins (Explicit) always relied on the Implicit joins created by the where clause.

In Outer Joins we have Right Outer Joins and Left Outer Joins and Full Outer Joins. What this basically means is that if there is as foll:

Left Outer Join:
All the records in the first table will be displayed even though there is no corresponding records in the second table.

Right Outer Join:
All the records in the second table will be displayed even though there is no corresponding record in the first table.

Full Outer join.
All the records of both the table will be displayed.

A Good example is given here.
Join (SQL) – Wikipedia, the free encyclopedia