发布时间 : 星期日 文章(完整版)工资管理系统(论文范文_JSP_JAVA_毕业设计)更新完毕开始阅读26746c51df80d4d8d15abe23482fb4daa58d1d29
conn.dbClose(rs); sql=\ conn=null; }
try{
conn=new sqlconn(); catch(Exception exc){} }
rs=null; return ;
sql=\
conn.dbMod(sql);
conn.dbClose(rs);
JOptionPane jop=new JOptionPane();
jop.showMessageDialog(null,\删除成功!\提示信息\ }
catch(Exception se){}
} }
conn=null;
userChoice.remove(userChoice.getSelectedIndex()); nameTxt.setText(\pwdTxt.setText(\
把用户列表的第一用户名赋值给nameTxt文本框
}
public void itemStateChanged(ItemEvent ie){
nameTxt.setText(userChoice.getSelectedItem()); try{
conn=new sqlconn();连接数据库
sql=\语句 }
conn.dbClose(rs); conn=null; }
catch(Exception e){} }
rs=conn.getRs(sql); while(rs.next()){
pwdTxt.setText(rs.getString(\
5.3人员管理功能实现
人员管理部分包括人员信息查询、人员信息添加。当在菜单栏中选择“人员信息查询”后,弹出一界面,输入员工号,按“查询”按钮后,即可查询。如图5.6所示。
图5.6查询员工信息
当在菜单栏选中“添加员工信息”后,弹出一界面,在该界面上有添加、修改、删除、清空、退出五个按钮,要想做某个操作,就输入相应信息,点击对应的按钮来实现。在这举例添加员工信息,如图5.7所示。
图5.7添加员工信息
人员管理功能实现的核心代码如下: 员工信息查询:
public void initChoice() { try{
conn=new sqlconn();
sql=\ }
conn.dbClose(rs); conn=null; }
catch(Exception e){} }
public void actionPerformed(ActionEvent ae){ if(ae.getActionCommand().equals(\退出\
dispose();
rs=conn.getRs(sql); while(rs.next()){
userChoice.addItem(rs.getString(\
if(ae.getActionCommand().equals(\查询\
if(idTxt.getText().equals(\
JOptionPane jop=new JOptionPane();
jop.showMessageDialog(null,\请输入你要查询既内容!\警告\ dispose();
uInfoQue uiq=new uInfoQue(); return ;
}
sql=\* from employees where id='\and
name='\
if(!(idTxt.getText().equals(\
sql=\* from employees where id='\and
name='\
if(!(idTxt.getText().equals(\
sql=\
*
from
employees
where
else
id='\
else
sql=\
*
from
employees
where
name='\
conn=new sqlconn(); try{
rs=conn.getRs(sql); if(rs.next()){
idTxt.setText(rs.getString(\nameTxt.setText(rs.getString(\sSexLab.setText(rs.getString(\sAgeLab.setText(rs.getString(\sPostLab.setText(rs.getString(\sDtmtLab.setText(rs.getString(\