六、算法实现
1、添加职工
if (e.getActionCommand().equals("确定")) {
sql = "select * from 员工基本信息 where 职工号='" +
numtext.getText() + "'";
try {
rs = con.getrs(con.con, sql); if (rs.next()) {
jop.showMessageDialog(null, "职工号已存在,请输入另外的
职工号", "错误", -1);
} else {
sql = "insert into 员工基本信息(职工号,姓名,性别,部门名,岗
位,出生年月,婚姻状况,联系电话,住址) values('"+numtext.getText()+"','"+nametext.getText()+"','"+xbtext.getText()+"','"+bmchoice.getSelectedItem()+"','"+gwchoice.getSelectedItem()+"','"+csnytext.getText()+"','"+hyzktext.getText()+"','"+lxdhtext.getText()+"','"+zztext.getText()+"')";