数据库工资管理系统报告和代码大全 下载本文

FROM updated,部门

WHERE 部门.部门名称=updated.部门名称 GO

(六)索引

为提高检索性能,为表创建符合索引,其索引项为工号、姓名。

CREATE INDEX 工号_姓名_ind ON 员工(工号,姓名) GO

Java代码

insert into 部门 values('财务部','王玲','20') insert into 部门 values('生产部','丽丽','400') insert into 部门 values('董事会','李四','10') insert into 部门 values('后勤部','二子','40') insert into 部门 values('公关部','小丽','15') insert into 部门 values('行政部','琪琪','20') insert into 部门 values('企划部','小新','15') insert into 部门 values('销售部','小海','10') insert into 部门 values('人力资源部','丽子','5')

insert into 员工 values('1001','李民','男','25','天津','111000101','已婚','专科' ,'销售部','内销','4','职工')

insert into 员工 values('1002','李四','男','50','上海','111000102','已婚','本科' ,'董事长','null','30','董事长')

insert into 员工 values('1003','丽丽','女','25','北京','111000103','未婚','本科' ,'生产部','电工','8','生产部部长')

insert into 员工 values('1004','王玲','男','35','东京','111000104','已婚','研究生' ,'财务部','预算','6','财务部部长')

insert into 员工 values('1005','二子','女','30','江西','111000105','未婚','本科' ,'后勤部','车工','7','后勤部部长')

insert into 员工 values('1006','小丽','女','26','苏州','111000106','已婚','本科' ,'公关部','null','3','公关部部长')

insert into 员工 values('1007','小新','男','27','扬州','111000107','已婚','研究生' ,'企划部','主管','2','企划部部长')

insert into 员工 values('1008','琪琪','女','24','安徽','111000108','未婚','本科' ,'行政部','null','8','行政部部长')

insert into 员工 values('1009','小海','男','23','南京','111000109','已婚','专科' ,'销售部','主管','4','

销售部部长')

insert into 员工 values('1010','丽子','女','22','江西','111000110','未婚','本科' ,'人力资源部','null','4','人力资源部部长')

insert into 员工 values('1011','小美','女','26','海南','111000111','已婚','本科' ,'公关部','前台','5','职工')

insert into 员工 values('1012','小韩','男','20','山东','111000112','离异','本科' ,'财务部','融资','5','出纳')

insert into 工资 values('1001','2013-12','2500','500','25','2','15','4','加急','50','50','100','3500','3400')

insert into 工资 values('1002','2013-12','10000','600','100','5','25','2','null','0','0','0','15000','20000') insert into 工资 values('1003','2013-12','4000','500','30','2','30','4','核对','50','50','100','5000','4800') insert into 工资 values('1004','2013-12','3500','500','30','2','30','4','加急','50','50','100','5000','4800') insert into 工资 values('1005','2013-12','4000','500','30','2','30','4','加急','50','50','100','5000','4800') insert into 工资 values('1006','2013-12','4000','500','30','2','30','4','加急','50','50','100','5000','4800') insert into 工资 values('1007','2013-12','3500','500','30','2','30','4','审核','50','50','100','5200','5000') insert into 工资 values('1008','2013-12','3500','500','30','2','30','4','加急','50','50','100','5400','5200') insert into 工资 values('1009','2013-12','3500','500','30','2','30','4','审核','50','50','100','5000','4800') insert into 工资 values('1010','2013-12','3500','500','30','2','30','4','加急','50','50','100','4800','4300') insert into 工资 values('1011','2013-12','2500','500','25','2','15','4','加急','50','50','100','3500','3400') insert into 工资 values('1012','2013-12','2500','500','25','2','15','4','加急','50','50','100','3500','3400')

insert into 员工登陆密码 values('1001','1101') insert into 员工登陆密码 values('1002','1102') insert into 员工登陆密码 values('1003','1103') insert into 员工登陆密码 values('1004','1104') insert into 员工登陆密码 values('1005','1105') insert into 员工登陆密码 values('1006','1106') insert into 员工登陆密码 values('1007','1107') insert into 员工登陆密码 values('1008','1108') insert into 员工登陆密码 values('1009','1109') insert into 员工登陆密码 values('1010','1110')

insert into 员工登陆密码 values('1011','1111') insert into 员工登陆密码 values('1012','1112')

insert into 工龄工资 values('1','3000') insert into 工龄工资 values('2','4000') insert into 工龄工资 values('3','5000') insert into 工龄工资 values('4','6000') insert into 工龄工资 values('5','7000') insert into 工龄工资 values('6','8000') insert into 工龄工资 values('7','10000') insert into 工龄工资 values('8','12000') insert into 工龄工资 values('9','15000') insert into 工龄工资 values('10','20000') insert into 工龄工资 values('11','40000')

package WageMangement; import java.sql.*;

import javax.swing.JOptionPane; public class DBHelper {

private static String url=\

private static String user=\ private static Connection con=null; static { try{

Class.forName(\ }

catch(Exception ex){ ex.printStackTrace(); } }

public static ResultSet executeQuery(String sql){ ResultSet rs=null; try{

con = DriverManager.getConnection(url, user, password); Statement cmd=con.createStatement(); rs=cmd.executeQuery(sql);

}catch(Exception ex){ex.printStackTrace();}

return rs;

}

public static void executeUpdate(String sql){ try{

con=DriverManager.getConnection(url, user, password); Statement cmd=con.createStatement(); cmd.executeUpdate(sql);

}catch(Exception ex){ ex.printStackTrace(); }

finally { conclose(); } }

public static void conclose(){ try{

if (con!=null && !con.isClosed()){ con.close(); }

}catch(Exception ex){ ex.printStackTrace(); } } }

/*主界面类*/

package WageMangement; import java.awt.*;

import java.awt.event.*; import javax.swing.*;

public class WageMain extends JFrame implements ActionListener{ private JButton btn_quit=new JButton(\注销登录\

private JTextField ch20081798=new JTextField(\欢迎使用工资管理系统! ); /*创建菜单栏*/

private JMenuBar mainMune=new JMenuBar(); /*创建部门菜单项*/

private JMenu menudept=new JMenu(\部门信息管理\

private JMenuItem dept_insert=new JMenuItem(\添加新部门信息\ private JMenuItem dept_update=new JMenuItem(\更新部门信息\ private JMenuItem dept_del=new JMenuItem(\撤销部门\ /*创建员工菜单项*/

private JMenu menuemp=new JMenu(\员工基本信息管理\

private JMenuItem emp_insert=new JMenuItem(\添加新员工信息\ private JMenuItem emp_update=new JMenuItem(\更新员工信息\