1.采用DB2创建以下结构数据表:
(1)TableName:MONTH_TOTAL
FIELD NAME TYPE
ID BIGINT 自动递增
YEAR BIGINT
MONTH BIGINT
TOTAL BIGINT
EMPLOYEE_ID BIGINT
(2)TableName:EMPLOYEE_INFO
ID BIGINT 自动递增
NAME VARCHAR
2.从指定的名为monthTotalData.xml的XML文件中读取数据插入到MONTH_TOTAL,EMPLOYEE_INFO 表中。
XML文件数据结构:
<data>
<monthTotalData>
<year>1996</year>
<month>1</month>
<total>200</total>
<employeeId>2</employeeId>
</monthTotalData>
<monthTotalData>
<year>1996</year>
<month>2</month>
<total>300</total>
<employeeId>2</employeeId>
</monthTotalData>
<monthTotalData>
<year>1996</year>
<month>5</month>
<total>500</total>
<employeeId>3</employeeId>
</monthTotalData>
<monthTotalData>
<year>1997</year>
<month>8</month>
<total>500</total>
<employeeId>3</employeeId>
</monthTotalData>
<monthTotalData>
<year>1997</year>
<month>9</month>
<total>600</total>
<employeeId>2</employeeId>
</monthTotalData>
<monthTotalData>
<year>1997</year>
<month>10</month>
<total>600</total>
<employeeId>2</employeeId>
</monthTotalData>
<monthTotalData>
<year>2009</year>
<month>3</month>
<total>600</total>
<employeeId>1</employeeId>
</monthTotalData>
<monthTotalData>
<year>2010</year>
<month>5</month>
<total>700</total>
<employeeId>1</employeeId>
</monthTotalData>
<monthTotalData>
<year>2009</year>
<month>9</month>
<total>500</total>
<employeeId>2</employeeId>
</monthTotalData>
</data>
EmployeeData.xml
<data>
<employee>
<id>1</id>
<name>张三</name>
</employee>
<employee>
<id>2</id>
<name>李四</name>
</employee>
<employee>
<id>3</id>
<name>王五</name>
</employee>
</data>
3.采用JAVA编写WEB应用程序连接DB2数据库从MONTH_TOTAL表中查询数据,统计每一年各个季度的total和,并且采用以下格式显示在JSP页面上:
员工名称 年份(year) 第一季度(total) 第二季度(total) 第三季度(total) 第四季度(total)
张三 1996 500 600 700 800
李四 1997 800 300 600 900
....
4.开发环境
WEB服务器为TOMCAT6.0
开发环境Eclipse 3.5
数据库DB2