數(shù)據(jù)庫(kù)課程設(shè)計(jì)—企業(yè)工資管理系統(tǒng)(java版完整代碼)_第1頁(yè)
數(shù)據(jù)庫(kù)課程設(shè)計(jì)—企業(yè)工資管理系統(tǒng)(java版完整代碼)_第2頁(yè)
數(shù)據(jù)庫(kù)課程設(shè)計(jì)—企業(yè)工資管理系統(tǒng)(java版完整代碼)_第3頁(yè)
已閱讀5頁(yè),還剩53頁(yè)未讀, 繼續(xù)免費(fèi)閱讀

下載本文檔

版權(quán)說(shuō)明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請(qǐng)進(jìn)行舉報(bào)或認(rèn)領(lǐng)

文檔簡(jiǎn)介

1、得分:課程設(shè)計(jì)報(bào)告企業(yè)工資管理系統(tǒng)XXXXXX XX姓名班級(jí)學(xué)號(hào)XXX XXX課程名稱數(shù)據(jù)庫(kù)原理與應(yīng)用指導(dǎo)教師201X年X月X日目錄一. 工資管理系統(tǒng)需求分析1.1功能需求功能劃分功能描述1.2性能需求1.3數(shù)據(jù)流圖二. 總體設(shè)計(jì)2.1數(shù)據(jù)庫(kù)概念設(shè)計(jì)2.2功能模塊三. 系統(tǒng)詳細(xì)設(shè)計(jì)3.1數(shù)據(jù)庫(kù)邏輯設(shè)計(jì)3.2各模塊功能職工信息管理系統(tǒng)職工工資管理系統(tǒng)職工津貼管理系統(tǒng)四. 系統(tǒng)實(shí)現(xiàn)4.1 界面截圖主界面與工資基本信息界面4.1.2 登錄界面4.1.3 系統(tǒng)主界面信息錄入,修改,刪除,查詢界面4.2設(shè)計(jì)代碼五. 實(shí)驗(yàn)總結(jié)1、需 求 分 析1.1 功 能 需 求1.1.1 功 能 劃 分(1) 、員工

2、信息表;與時(shí)反映員工的基本信息(2) 、員工津貼表,反映員工津貼(3) 、員工基本工資表1.1.2 功能 描 述(1) 、基本工資的設(shè)定(2) 、津貼的設(shè)定(3) 、計(jì)算出月工資(4) 、錄入員工工資信息(5) 、添加員工工資信息(6) 、更改員工工資信息1.2 性 能 需 求 此工資管理系統(tǒng)對(duì)工資數(shù)據(jù)精度的計(jì)算能在默認(rèn)情況之下精確到小數(shù) 點(diǎn)后 3 位小數(shù),即是精確到分的計(jì)算。但在用戶使用過(guò)程中,能自行根據(jù) 實(shí)際情況進(jìn)行小數(shù)計(jì)算精度的設(shè)定, 最大能允許保留小數(shù)點(diǎn)后 5 位的精度。 在時(shí)間特性上,當(dāng)用戶發(fā)出命令請(qǐng)求時(shí)的服務(wù)器的響應(yīng)時(shí)間、對(duì)數(shù)據(jù)更新 處理、工資數(shù)據(jù)的查詢檢索等上,同樣要求系統(tǒng)響應(yīng)時(shí)

3、間不會(huì)超過(guò) 0.5 秒 時(shí)間。系統(tǒng)支持多種操作系統(tǒng)的運(yùn)行環(huán)境,多不同操作系統(tǒng),不同文件格 式的磁盤上的數(shù)據(jù)均能實(shí)現(xiàn)信息的互通,與共享。當(dāng)服務(wù)器移植到其他的 系統(tǒng)平臺(tái),如: Linux 平臺(tái)下時(shí),同樣能和其他的系統(tǒng)進(jìn)行數(shù)據(jù)存取同步,不會(huì)出現(xiàn)系統(tǒng)之間互不兼容的情況,系統(tǒng)支持多系統(tǒng)之間的互連互通,系 統(tǒng)有巨大的強(qiáng)健性。本課程設(shè)計(jì)是用 Java語(yǔ)言編寫,mysql數(shù)據(jù)庫(kù)1.3數(shù)據(jù)流圖根據(jù)工資管理要求與用戶需求調(diào)查分析,得到以下數(shù)據(jù)流圖圖1.1第一層數(shù)據(jù)流圖添加操作輸入職工基本信息修改職工信息修改操作工資表刪除職工記錄刪除操作職工號(hào)查詢操作圖1.2職工信息的載入圖1.4考勤的信息載入2. 總體設(shè)計(jì)2.1

4、數(shù)據(jù)庫(kù)概念設(shè)計(jì)有了數(shù)據(jù)流圖,用E-R圖來(lái)說(shuō)明工資信息管理系統(tǒng)的數(shù)據(jù)庫(kù)概念模式,如圖m圖2.1實(shí)體之間關(guān)系E-R圖22功能模塊3. 系統(tǒng)詳細(xì)設(shè)計(jì)3.1數(shù)據(jù)庫(kù)邏輯設(shè)計(jì)將以上E-R轉(zhuǎn)換成如下關(guān)系模式員工(職工號(hào),姓名,密碼)工資(職工號(hào),姓名,基本工資,)津貼(職工號(hào),姓名,獎(jiǎng)金)其中,標(biāo)有下劃線的字段表示為該數(shù)據(jù)表的主碼,即主關(guān)鍵字。在上面的實(shí)體以與實(shí)體之間關(guān)系的基礎(chǔ)上,形成數(shù)據(jù)庫(kù)中的表格以與各個(gè)表格 之間的關(guān)系工資信息管理系統(tǒng)數(shù)據(jù)庫(kù)中各個(gè)表格的設(shè)計(jì)結(jié)果如下面的幾個(gè)表格所 示。每個(gè)表格表示在數(shù)據(jù)庫(kù)中的一個(gè)表。表一:?jiǎn)T工信息表:列名數(shù)據(jù)類型可否取空備注說(shuō)明noChar ( 8 )NOT NULL職工

5、號(hào)(主鍵)n ameChar (10)NOT NULL職工姓名miSmalli ntNOT NULL登錄密碼表二:基本工資表:列名數(shù)據(jù)類型可否取空備注說(shuō)明noChar ( 8 )NOT NULL職工號(hào)(主鍵)n ameChar (10)NOT NULL職工姓名JbmoneyNOT NULL基本工資表四:津貼信息表列名數(shù)據(jù)類型可否為空備注說(shuō)明noChar ( 8 )NOT NULL職工號(hào)(主鍵)n ameChar (10)NOT NULL職工姓名JtmoneyNOT NULL津貼3.2各模塊功能321職工信息管理系統(tǒng)功能為:財(cái)務(wù)部門相關(guān)人員錄入、修改、刪除、查詢員工個(gè)人信息322職工工資管理系統(tǒng)

6、功能為:根據(jù)工資生成公式,按照員工的考勤情況與各種表現(xiàn)按月生 成相應(yīng)的工資;財(cái)務(wù)部門相關(guān)人員能錄入、修改、刪除、查詢每個(gè)月每個(gè) 員工的工資信息以與工資匯總;員工本人能查詢自己的工資信息以與工資 匯總;職工登陸查詢系統(tǒng)功能為:?jiǎn)T工本人能通過(guò)用戶名和密碼查詢自己的信息以與修改自己 的密碼;4. 系統(tǒng)實(shí)現(xiàn)4.1界面截圖主界面登錄界面管理員管理工資界面信息錄入,修改,刪除,查詢界面職工信息查詢界面職工密碼修改界面4.2設(shè)計(jì)代碼DB.javapackage wage_ma nageme nt;import javax.swi ng.*;class DB exte nds JFrame impleme n

7、ts Acti on Liste ner JFrame frame = new JFrame(”歡迎進(jìn)入企業(yè)工資管理系統(tǒng)");JLabel label = new JLabel("", JLabel.CENTER);JButton button1 = new JButton(”進(jìn)入系統(tǒng)");JButton button2 = new JButton(”退出系統(tǒng)");ImageIc on im = new ImageIc on ("1.jpg");JLabel a1 = new JLabel(im);void Create()

8、 (JPanel)JPanel pcontentPane=frame.getContentPane();pcontentPane.add(a1);pcontentPane.add(label);pcontentPane.setLayout(new FlowLayout();pcontentPane.add(button1);pcontentPane.add(button2);pcontentPane.setVisible(true);button1.addActionListener(this);button2.addActionListener(this);frame.setDefaultC

9、loseOperation(JFrame.EXIT_ON_CLOSE);frame.pack();frame.setBounds(200, 100, 550, 180);frame.setVisible(true);public static void main(String args) DB dome = new DB();dome.Create();public void acti on Performed(Acti on Eve nt e) if (butt on 1.equals(e.getSource() DL dl = new DL();dl.create();frame.disp

10、ose();退出if (butt on 2.equals(e.getSource() /System.exit(O);登陸DL.javapackage wage_ma nageme nt;import Quer y.Quer ypad;class DL extends JFrame implements ActionListener new ImageIcon("2.jpg");ImageIcon im =職 工 / 管 理 員 登 陸 ") 用 戶 名 ");密 碼 ");JLabel a2 = new JLabel(im);JFrame f

11、rame = new JFrame("JLabel label1 = new JLabel("JLabel label2 = new JLabel("JButton logonButton1 = new JButton(管 理 員 登 錄 ");JButton logonButton2 = new JButton(職 工 登 錄 ");JButton cancelButton = new JButton(退出 ");JTextField username = new JTextField(9);JPasswordField passw

12、ord = new JPasswordField(9);static String t1;static String t2;void create()JPanel p = (JPanel) frame.getContentPane();JPanel p1 = new JPanel(); p.setLayout(new FlowLayout(); p.add(a2);p.add(label1);p.setSize(5, 5);p.setLocation(4, 8);p.add(username);p.setSize(100, 200);p.setLocation(800, 800);p.add(

13、label2);p.setSize(50, 20);p.setLocation(40, 80);p.add(password);p.setSize(100, 20);p.setLocation(80, 120);p.add(logonButton1);p.add(logonButton2);p.add(cancelButton);p.setBackground(Color.cyan);p.setVisible(true);logonButton1.addActionListener(this);logonButton2.addActionListener(this);cancelButton.

14、addActionListener(this);frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);frame.pack();frame.setBounds(200, 100, 500, 220);frame.setVisible(true);public void actionPerformed(ActionEvent e)t1 = username.getText();t2 = password.getText();if(e.getSource()=logonButton1)if( username.getText().equals(&

15、quot;admin") = true&& (password.getText().equals("admin")= true)JOptionPane.showMessageDialog(this," 登 錄成功 !");GZGLZ JM gz = new GZGLZ JM();gz.create();frame.dispose(); else JOptionPane.showMessageDialog(null," 輸 入用戶 名或 密碼錯(cuò) 誤 !");if (e.getSource()=logonButt

16、on2)tr y Connection con;Statement ps;ResultSet rs;String sql = null;e();con = DriverManager.getConnection("jdbc:mysql:/localhost:3306/wage management","root","jxb");sql="select * from workerinfo wh erename='"+t1+"' and mi='"+t2+"'

17、;"ps=(PreparedStatement)con.prepareStatement(sql);rs = ps.executeQuer y(sql);if(rs.next()if(rs.getString("name").equals(t1)rs.getString("mi").equals(t2)YGDL JM yg = new YGDL JM();yg.create();frame.dispose();JOptionPane.showMessageDialog(this, "登錄 成功 !");this.dispos

18、e();else JOptionPane.showMessageDialog(this,入用 戶名 或密碼 錯(cuò) 誤! ");catch (Exception e1) / TODO Auto-generated catch blocke1.printStackTrace();&&"輸if (cancelButton.equals(e.getSource() /退 出System.exit(O);GZGLZ JM.java/ 工資管理主界面 package wage_ma nageme nt;import javax.swi ng.Im ageIc on;imp

19、ort javax.swi ng.JButton;import javax.sw in g.JFrame;import javax.swi ng.JLabel;import javax.swi ng.JPa nel;classGZGLZ JMextendsJFrameimpleme ntsActi on Liste ner JFrame f = new JFrame("JButton b1 = new JButto n("JButton b2 = new JButto n("工資管理系統(tǒng)");工資管理");員工信息管理");JButt

20、on b3 = new JButton(" 返 回 "); ImageIcon im = new ImageIcon("3.jpg");JLabel a1 = new JLabel(im);void create() JPanel p = (JPanel) f.getContentPane(); p.setLayout(new FlowLayout();p.add(a1);p.add(b1);p.add(b2);p.add(b3);p.setBackground(Color.cyan); p.setVisible(true);b1.addActionLi

21、stener(this);b2.addActionListener(this);b3.addActionListener(this);f.setBounds(200, 100, 500, 200); f.setVisible(true);返回public void actionPerformed(ActionEvent e) if (b3.equals(e.getSource() /19 / 56DL d = new DL();d.create();f.dispose();員工信息管理工資管理 if (b2.equals(e.getSource() /Y GGL yg = new Y GGL(

22、);yg.create();f.dispose();if (b1.equals(e.getSource() /GZGL gz = new GZGL();gz. create();f.dispose();/ 工資管理GZGL.javapackage wage_ma nageme nt;implementspublic class GZGL extends JFrame ActionListener JFrame f = new JFrame(" 工 資 管 理 ");JButton b1 = new JButton(" 錄 入 ");JButton b2

23、= new JButton("修 改 ");JButton b3 = new JButton("JButton b4 = new JButton("JButton b5 = new JButton("刪 除 ");查 詢 所 有 ");返 回 ");JTextField tf1 = new JTextField(4);JTextField tf2 = new JTextField(4);JTextField tf3 = new JTextField(4);JTextField tf4 = new JTextFiel

24、d(4);JTextField tf5 = new JTextField(6);JTextField tf6 = new JTextField(7);String cloum = "職 工號(hào) ", "姓名", "津 貼 ", "月 基 本工資 "," 月 薪 "Object row = new Object505;JTable table = new JTable(row, cloum);JScrollPane scrollpane = new JScrollPane(table);JSplit

25、Panesplitpane= newJSplitPane(JSplitPane.VERTICAL_SPLIT);void create() JPanel p = (JPanel) f.getContentPane();p.setLayout(new FlowLayout();p.add(scrollpane);p.add(splitpane);JPanel p1 = new JPanel();p1.add(b1);p1.add(b2);p1.add(b3);p1.add(b4);p1.add(b5);JPanel p2 = new JPanel(); p2.setBackground(Colo

26、r.cyan); p2.add(scrollpane);JPanel p3 = new JPanel(); p.setLayout(new FlowLayout();p.add(new JLabel("");p.add(new JLabel(" p.add(tf1);p.add(new JLabel(" p.add(tf2);p.add(new JLabel(" p.add(tf3);p.add(new JLabel(" p.add(tf4);p.add(new JLabel("職 工 號(hào) ");姓 名 "

27、;);津 貼 ");月 基 本 工 資 ");月 薪 ");p.add(tf5);p.add(new JLabel(" 在 此處輸入 職 工號(hào) 點(diǎn) 擊查 詢 刪除 ");p.add(tf6);splitpane.add(p1, splitpane.TOP);splitpane.add(p2, splitpane.BOTTOM);splitpane.setDividerLocation(50);p.setBackground(Color.CYAN);b1.addActionListener(this);b2.addActionListener(t

28、his);b3.addActionListener(this);b4.addActionListener(this);b5.addActionListener(this);f.setBounds(200, 100, 500, 600);f.setResizable(true);/ 可 以 調(diào) 整 界 面 大 小f.setVisible(true);public void actionPerformed(ActionEvent e) if (b1.equals(e.getSource() / 錄 入Connection con;Statement sql;tr y catch (ClassNot

29、FoundException e1) + e1);tr y con=DriverManager.getConnection("jdbc:mylhost:3306/wage management","root","jxb");sql = con.createStatement();String insertStr = "INSERT INTO (no,name,jt)VALUES('"+tf1.getText()+"','"+tf2.getText()+" 

30、9;,'"+tf3.getText()+"');"sql.executeUpdate(insertStr);String insertStr1 = "INSERT INTO(no,name,jb)VALUES('"+tf1.getText()+"','"+tf2.getText()+ "','"+tf4.getText()+"');"sql.executeUpdate(insertStr1);con.close();JOp

31、tionPane.showMessageDialog(this,成功 !"); catch (SQLException e1) JOptionPane.showMessageDialog(this, 失敗 !");welfarewageinfo"入錄"入錄if (b2.equals(e.getSource() / 修 改 Connection con;Statement sql;tr y catch (ClassNotFoundException e1) + e1); tr y conDriverManager.getConnection("j

32、dbc:mysql:/localhost:33 06/wage management","root","jxb");sql = con.createStatement();welfare SETwageinfoString updateStr = "UPDATE jt='"+tf3.getText()+"',name='"+tf2.getText()+"'where no='"+tf1.getText()+"'"sql

33、.executeUpdate(updateStr);String updateStr1 = "UPDATE SET jb='"+tf4.getText()+"',name='"+tf2.getText()+"'where no='"+tf1.getText()+"'"sql.executeUpdate(updateStr1);JOptionPane.showMessageDialog(this, " 修 改 成功 !");con.close();

34、catch (SQLException e1) JOptionPane.showMessageDialog(this, " 信 息 不存 在! ");if (b3.equals(e.getSource() /刪 除Connection con;Statement sql;ResultSet rs;tr y catch (ClassNotFoundException e1) + e1); tr y con = DriverManager.getConnection("jdbc:mysql:/localhost:3306/wage management",&

35、quot;root","jxb");sqlcon.createStatement(ResultSet.TYPE_SCROLL_SENSITIResultSet.CONCUR_READ_ONLY);sql.executeUpdate("DELETE FROMwhereno='"+tf6.getText()+"'");sql.executeUpdate("DELETE FROMwhereno='"+tf6.getText()+"'");JOptionPane

36、.showMessageDialog(this,成功 !");con.close(); catch (SQLException e1) JOptionPane.showMessageDialog(this,失敗 !");if (b4.equals(e.getSource() / 查 詢 全 部Connection con;Statement sql;ResultSet rs;/Vector vector = new Vector();VE,wageinfowelfare"刪除"刪除tr y 連接 catch (ClassNotFoundException

37、 e1) JOptionPane.showMessageDialog(this, 數(shù)據(jù) 庫(kù)失 ?。?quot;); tr y conDriverManager.getConnection("jdbc:mysql:/localhost:33 06/wage management","root","jxb");sql con.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE, ResultSet.CONCUR_READ_ONLY);if (b4.equals(e.getSource() for

38、 (int i = 0; i < 50; i+)for (int j = 0; j < 4; j+)table.setValueAt("", i, j);inctwherers = sql.executeQuer y("select dist fromwageinfo ,=");int k = -1;while (rs.next() +k ;String no = rs.getString(1);String name = rs.getString(2);String jb =

39、rs.getString(3);String jt = rs.getString(6);int sum= rs.getInt(3)+rs.getInt(6);table.setValueAt(no, k , 0); table.setValueAt(name, k , 1); table.setValueAt(jb, k , 3);table.setValueAt(jt, k , 2);table.setValueAt(sum,k,4); catch (SQLException e1) 失??!JOptionPane.showMessageDialog(this," 查 詢"

40、);if (b5.equals(e.getSource() /返 回GZGLZ JM gl=new GZGLZ JM();gl.create();f.dispose();/ 修改管理主界面YGGLZ JM.java package wage_ma nageme nt;import javax.swi ng.JButton;import javax.sw in g.JFrame;import javax.swi ng.JOptio nPane;DL implementspublic class YGDL JM extendsActionListener JFrame f = new JFrame

41、("工 資 管 理 ");JButton b1= new JButton("查 詢 個(gè) 人 工 資 ");JButton b2= new JButton("修 改 密 碼 ");JButton b3= new JButton("返 回 ");Stringcloum = "職 工號(hào) ","姓名", "津 貼 ", "月 基 本工資"," 月 薪 "Object row = new Object505;JTable ta

42、ble = new JTable(row, cloum);JScrollPane scrollpane = new JScrollPane(table);JSplitPane splitpane = new JSplitPane(JSplitPane.VERTICAL_SPLIT);void create() JPanel p = (JPanel) f.getContentPane();p.setLayout(new FlowLayout();p.add(scrollpane); p.add(splitpane);JPanel p1 = new JPanel();p1.add(b1);p1.a

43、dd(b2);p1.add(b3);JPanel p2 = new JPanel(); p2.setBackground(Color.cyan); p2.add(scrollpane);JPanel p3 = new JPanel(); p.setLayout(new FlowLayout();splitpane.add(p1, splitpane.TOP);splitpane.add(p2, splitpane.BOTTOM); splitpane.setDividerLocation(50);p.setBackground(Color.CYAN);b1.addActionListener(

44、this); b2.addActionListener(this); b3.addActionListener(this);f.setBounds(200, 100, 500, 550); f.setResizable(true);/ 可 以 調(diào) 整 界 面 大 小 f.setVisible(true);public void actionPerformed(ActionEvent e) if (b1.equals(e.getSource() /查 詢 個(gè) 人 工 資Connection con;Statement sql;ResultSet rs;tr y catch (ClassNotFo

45、undException e1) + e1);tr y conDriverManager.getConnection("jdbc:mysql:/localhost:3306/wage management","root","jxb");sql con.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE,ResultSet.CONCUR_READ_ONLY);if (b1.equals(e.getSource() for (int i = 0; i < 50; i+)for (int j

46、 = 0; j < 4; j+)table.setValueAt("", i, j);rs = sql.executeQuer y("select distinct from wageinfo ,welfare,workerinfowherewageinfo.no=welfare.no and wageinfo.no=workerinfo.no ='"+t1+"'andworkerinfo.mi='"+t2+"'");int k = -1;w

47、hile (rs.next() +k ;String no = rs.getString(1);String name = rs.getString(2);String jb = rs.getString(3);String jt = rs.getString(6);int sum= rs.getInt(3)+rs.getInt(6);table.setValueAt(no, k , 0); table.setValueAt(name, k , 1); table.setValueAt(jb, k , 3);table.setValueAt(jt, k , 2);table.setValueA

48、t(sum,k,4); catch (SQLExcepti on e1) JOpti onPan e.showMessageDialog(this,失敗!");if (b2.equals(e.getSource()/ 修改密碼XGMM xgmm=new XGMM();xgmm.create();if (b3.equals(e.getSource() /返回DL dl=new DL();dl.create();f.dispose();/修改管理Y GGL.javapackage wage_management;implementspublic class YGGL extends JF

49、rameActionListener JFrame f = new JFrame(員 工 信 息 管 理 ");JButton b1 = new JButton(添 加 新 員 工 信 息 ");JButton b2 = new JButton(修 改 員 工 信 息 ");JButton b3 = new JButton(刪 除 員 工 信 息 ");JButton b4 = new JButton(查 詢 所 有 員 工 信 息 ");JButton b5 = new JButton(返 回 ");JTextField tf1 =

50、 new JTextField(4);JTextField tf2 = new JTextField(4);JTextField tf3 = new JTextField(4);JTextField tf4 = new JTextField(4);JTextField tf5 = new JTextField(6);JTextField tf6 = new JTextField(7);String cloum = "職 工號(hào) ", "姓名", "津 貼 ", "月 基 本工資 "," 月 薪 "

51、," 登 陸 密 碼 "Object row = new Object506;JTable table = new JTable(row, cloum);JScrollPane scrollpane = new JScrollPane(table);JSplitPanesplitpane= newJSplitPane(JSplitPane.VERTICAL_SPLIT);void create() JPanel p = (JPanel) f.getContentPane();p.setLayout(new FlowLayout();p.add(scrollpane);p.a

52、dd(splitpane);JPanel p1 = new JPanel();p1.add(b1);p1.add(b2);p1.add(b3);p1.add(b4);p1.add(b5);JPanel p2 = new JPanel();p2.setBackground(Color.cyan);p2.add(scrollpane);職 工 號(hào) ");姓 名 ");p.setLayout(new FlowLayout(); p.add(new JLabel(""); p.add(new JLabel(" p.add(tf1); p.add(new

53、 JLabel("p.add(tf2);p.add(new JLabel("p.add(tf3);p.add(new JLabel("p.add(tf4);p.add(new JLabel("津 貼 ");月 基 本 工 資 ")登 陸 密 碼 ");p.add(tf5);p.add(new JLabel("在 此 處 輸 入 職 工 號(hào) 點(diǎn)擊查 詢刪 除");p.add(tf6);splitpane.add(p1, splitpane.TOP);splitpane.add(p2, splitpane.B

54、OTTOM);splitpane.setDividerLocation(50);p.setBackground(Color.CYAN);b1.addActionListener(this);b2.addActionListener(this);b3.addActionListener(this);b4.addActionListener(this);b5.addActionListener(this);f.setBounds(200, 100, 600, 600);f.setResizable(true);/ 可 以 調(diào) 整 界 面 大 小 f.setVisible(true);public

55、void actionPerformed(ActionEvent e) if (b1.equals(e.getSource() /添 加 新 員 工 信 息Connection con;Statement sql;tr y catch (ClassNotFoundException e1) JOptionPane.showMessageDialog(this," 連 接數(shù)據(jù) 庫(kù)失 ?。?quot;);tr y con = DriverManager.getConnection("jdbc:mysql:/localhost:3306/wage management"

56、,"root","jxb");sql = con.createStatement();String insertStr = "INSERT INTO welfare (no,name,jt)VALUES('"+tf1.getText()+"','"+tf2.getText()+" ','"+tf3.getText()+"');"sql.executeUpdate(insertStr);String insertStr1 = &q

57、uot;INSERT INTO wageinfo (no,name,jb)VALUES('"+tf1.getText()+"','"+tf2.getText()+ "','"+tf4.getText()+"');"sql.executeUpdate(insertStr1);String insertStr2 = "INSERT INTO workerinfo (no,name,mi)VALUES('"+tf1.getText()+"','"+tf2.getText()+ "','"+tf5.getText()+"');"sql.executeUpdate(insertStr2);JOptionPane.showMessageDialog(this,成功 !");con.close(); catch (SQLException e1) JOptionPane.showMessa

溫馨提示

  • 1. 本站所有資源如無(wú)特殊說(shuō)明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請(qǐng)下載最新的WinRAR軟件解壓。
  • 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請(qǐng)聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
  • 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁(yè)內(nèi)容里面會(huì)有圖紙預(yù)覽,若沒(méi)有圖紙預(yù)覽就沒(méi)有圖紙。
  • 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
  • 5. 人人文庫(kù)網(wǎng)僅提供信息存儲(chǔ)空間,僅對(duì)用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對(duì)用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對(duì)任何下載內(nèi)容負(fù)責(zé)。
  • 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請(qǐng)與我們聯(lián)系,我們立即糾正。
  • 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時(shí)也不承擔(dān)用戶因使用這些下載資源對(duì)自己和他人造成任何形式的傷害或損失。

最新文檔

評(píng)論

0/150

提交評(píng)論