我有一个返回以下内容的查询
select tyear,sum(total) as total,sum(expected) as expected
from
(
select extract(year from date) as tyear ,sum(paid) as total ,sum(amount) as expected
from term1 group by tyear
union all
select extract(year from date) as tyear ,sum(paid) as total ,sum(amount) as expected
from term2
group by tyear
union all
select extract(year from date) as tyear ,sum(paid) as total ,sum(amount) as expected
from term3
group by tyear
)a group by tyear
从MySQL命令行或工作台我得到这些结果
tyear total expected
2012 30000 900000
2013 40000 50000
2014 320000 50000
2015 100000 200000
在我的java代码中,我使用rs2xml.jar
来显示上面的表格。问题是,它没有显示第一行,也没有显示列名。
下面的代码行显示表格结果
table3.setModel(DbUtils.resultSetToTableModel(rs));
这是我在java中的内容
2013 11000 13000
2014 772565 66071989
2015 65000 87000