}
// TODO Auto-generated catch block e1.printStackTrace();
con.dbclose(con.con,rs); con=null; rs = null; } 7.部门工资查询
if(e.getActionCommand().equals("平均工资"))
{
int count=0; float gzh=0; con=new condb();
sql="select * from 工资表,员工基本信息 WHERE 部门名='" +
bmchoice.getSelectedItem()+ "' AND 员工基本信息.职工号=工资表.职工号 ";
rs=con.getrs(con.con, sql); try{
while(rs.next()) { }
gzh=gzh+rs.getFloat("工资"); count++;
}catch (SQLException e2){ }
String a=new String("该部门平均工资为"); float b=gzh/count; a+=b;
jop.showMessageDialog(null,a, "错误", -1);
e2.printStackTrace();