【SQL开源代码栏目提醒】:文章导读:在新的一年中,各位网友都进入紧张的学习或是工作阶段。
网学会员整理了SQL开源代码-java_职工信息管理系统源代码 - 其它资料的相关内容供大家参考,祝大家在新的一年里工作和学习顺利!
源
代码package lesson2import java.
sql.public class employee public String num public String name public String sex public String age public String edu public String sla public String add public String tel public void initString x1String x2String x3String x4Stringx5String x6String x7String x8 numx1 namex2 sexx3 agex4 edux5 slax6 addx7 telx8 public void loadString f try Class.forNamequotcom.microsoft.sqlserver.jdbc.SQLServerDriverquot Stringurlquotjdbc:sqlserver://localhost:1433DatabaseNameemployeequot String userNamequotsaquot String passwordquotxhwquot ConnectionconnDriverManager.getConnectionurluserNamepassword ifconnnull System.out.printlnquot已成功地与
SQL Server 2005数据库建立连接!quot Statement stmtconn.createStatement stmt.executeUpdatef stmt.close catchException e e.printStackTrace package lesson2import java.awt.import java.awt.event.import java.
sql.public class lesson2_1 static Frame f CardLayout myCard Panel p1 Panel p2 Panel p3 Panel p4 Panel p5 Panel p6 Panel p7 Panel p8 public static void mainString args lesson2_1 testnew lesson2_1 test.go1 test.go2 test.go3 test.go4 test.go5 test.go6 test.go7 test.go8public void go1 fnew Framequot呵 呵 quot myCardnew CardLayout f.setLayoutmyCard p1new Panel Button b1b2b3 Label L1 TextField te1 final TextField te2 p1.setLayoutnew GridBagLayout GridBagConstraints cnew GridBagConstraints Panel p1_1new Panel p1_1.setLayoutnew GridBagLayout GridBagConstraints xnew GridBagConstraints b1new Buttonquot 请 输 入 用 户 名 quot b1.setBackgroundColor.CYAN x.insetsnew Insets50505050 x.gridx0 x.gridy0 x.gridwidth1 x.gridheight1 p1_1.addb1x b2new Buttonquot 请 输 入 密 码 quot b2.setBackgroundColor.CYAN x.gridx0 x.gridy5 x.gridwidth1 x.gridheight1 p1_1.addb2x te1new TextField15 c.insetsnew Insets400400 x.gridx5 x.gridy0 x.gridwidth1 x.gridheight1 p1_1.addte1x te2new TextField15 x.gridx5 x.gridy5 x.gridwidth1 x.gridheight1 p1_1.addte2x L1new Labelquot 欢 迎 进 入职 工 管 理 系 统 quot L1.setBackgroundColor.CYAN c.gridx0 c.gridy0 c.gridwidth0 c.gridheight1 p1.addL1c b3new Buttonquot 登 录quot b3.setBackgroundColor.CYAN c.gridx0 c.gridy10 c.gridwidth5 c.gridheight5 p1.addb3c c.gridx0 c.gridy20 c.gridwidth5 c.gridheight5 p1.addp1_1c p1.setBackgroundColor.green f.addp1quotFirstquot myCard.showfquotFirstquot f.setSize600600 f.setVisibletrue f.addWindowListener new WindowAdapter public void windowClosingWindowEvent e System.exit0 b3.addMouseListenernew MouseAdapter public void mouseClickedMouseEvent e String xte2.getText int yInteger.parseIntx ify106 myCard.showfquotSecondquot public void go2 p2new Panel Button b1b2b3b4b5b6 Label L1 p2.setLayoutnew GridBagLayout GridBagConstraints cnew GridBagConstraints c.insetsnew Insets50080 b1 new Buttonquot1 职 工 信 息 录 入quot b1.setBackgroundColor.CYAN c.gridx1 c.gridy50 c.gridwidth5 c.gridheight50 p2.addb1c b2new Buttonquot2 职 工 信 息 浏 览quot b2.setBackgroundColor.CYAN c.gridx1 c.gridy100 c.gridwidth5 c.gridheight50 p2.addb2c b3new Buttonquot3 职 工 信 息 查 询quot b3.setBackgroundColor.CYAN c.gridx1 c.gridy150 c.gridwidth5 c.gridheight50 p2.addb3c b4new Buttonquot4 职 工 信 息 排 序quot b4.setBackgroundColor.CYAN c.gridx1 c.gridy200 c.gridwidth5 c.gridheight50 p2.addb4c b5new Buttonquot5 职 工 信 息 修 改quot b5.setBackgroundColor.CYAN c.gridx1 c.gridy250 c.gridwidth5 c.gridheight50 p2.addb5c b6new Buttonquot6 职 工 信 息 删 除quot b6.setBackgroundColor.CYAN c.gridx1 c.gridy300 c.gridwidth5 c.gridheight50 p2.addb6c L1new Labelquot 欢 迎 进 入职 工 管 理 系 统 quot L1.setBackgroundColor.CYAN c.gridx1 c.gridy0 c.gridwidth5 c.gridheight10 p2.addL1c p2.setBackgroundColor.green f.addp2quotSecondquot b1.addMouseListenernew MouseAdapter public void mouseClickedMouseEvent e myCard.showfquotThirdquot b2.addMouseListenernew MouseAdapter public void mouseClickedMouseEvent e myCard.showfquotFourthquot b3.addMouseListenernew MouseAdapter public void mouseClickedMouseEvent e myCard.showfquotFifthquot b4.addMouseListenernew MouseAdapter public void mouseClickedMouseEvent e myCard.showfquotSixthquot b5.addMouseListenernew MouseAdapter public void mouseClickedMouseEvent e myCard.showfquotSeventhquot b6.addMouseListenernew MouseAdapter public void mouseClickedMouseEvent e myCard.showfquotEighthquot public void go3 p3new Panel p3.setLayoutnew GridBagLayout GridBagConstraints cnew GridBagConstraints Button b1b2b3b4b5b6b7b8b9b10 final TextField te1te2te3te4te5te6te7te8 Label L1 c.insetsnew Insets605000 L1new Labelquot 请 输 入下 面 信 息 quot L1.setBackgroundColor.CYANc.gridx0c.gridy0c.gridwidth0c.gridheight1p3.addL1cb1new Buttonquot 工 号 quotb1.setBackgroundColor.CYANc.gridx0c.gridy10c.gridwidth1c.gridheight1p3.addb1cb2new Buttonquot 姓 名 quotb2.setBackgroundColor.CYANc.gridx35c.gridy10c.gridwidth1c.gridheight1p3.addb2cb3new Buttonquot 性 别 quotb3.setBackgroundColor.CYANc.gridx0c.gridy30c.gridwidth1c.gridheight1p3.addb3cb4new Buttonquot 年 龄 quotb4.setBackgroundColor.CYANc.gridx35c.gridy30c.gridwidth1c.gridheight1p3.addb4cb5new Buttonquot 学 历 quotb5.setBackgroundColor.CYANc.gridx0c.gridy50c.gridwidth1c.gridheight1p3.addb5cb6new Buttonquot 工 资 quotb6.setBackgroundColor.CYANc.gridx35c.gridy50c.gridwidth1c.gridheight1p3.addb6cb7new Buttonquot 住 址 quotb7.setBackgroundColor.CYANc.gridx0c.gridy70c.gridwidth1c.gridheight1p3.addb7cb8new Buttonquot 电 话 quotb8.setBackgroundColor.CYANc.gridx35c.gridy70c.gridwidth1c.gridheight1p3.addb8cb9new Buttonquot 提 交 quotb9.setBackgroundColor.CYANc.gridx10c.gridy100c.gridwidth1c.gridheight1p3.addb9cb10new Buttonquot 返 回 quotb10.setBackgroundColor.CYANc.gridx35c.gridy100c.gridwidth1c.gridheight1p3.addb10cte1new TextField10c.gridx10c.gridy10c.gridwidth1c.gridheight1p3.addte1cte2new TextField10c.gridx37c.gridy10c.gridwidth1c.gridheight1p3.addte2cte3new TextField10c.gridx10c.gridy30c.gridwidth1c.gridheight1p3.addte3cte4new TextField10c.gridx37c.gridy30c.gridwidth1c.gridheight1p3.addte4cte5new TextField10c.gridx10c.gridy50c.gridwidth1c.gridheight1p3.addte5cte6new TextField10c.gridx37c.gridy50c.gridwidth1c.gridheight1p3.addte6cte7new TextField10c.gridx10c.gridy70c.gridwidth1 c.gridheight1 p3.addte7c te8new TextField10 c.gridx37 c.gridy70 c.gridwidth1 c.gridheight1 p3.addte8c p3.setBackgroundColor.green f.addp3quotThirdquot b9.addMouseListenernew MouseAdapter public void mouseClickedMouseEvent e employee e1new employee e1.initte1.getTextte2.getTextte3.getTextte4.getText te5.getTextte6.getTextte7.getTextte8.getText String xquotquot String yquotquot String zquotquot String wquotquot String sqlquotinsert into xhw valuesquot sqlsqlxe1.numyzxe1.nameyzxe1.sexyzxe1.ageyzxe1.eduyz xe1.slayzxe1.addyzxe1.telyw e1.loadsql te1.setTextquotquot te2.setTextquotquot te3.setTextquotquot te4.setTextquotquot te5.setTextquotquot te6.setTextquotquot te7.setTextquotquot te8.setTextquotquot b10.addMouseListenernew MouseAdapter public void mouseClickedMouseEvent e myCard.showfquotSecondquot public void go4 p4new Panel p4.setLayoutnew GridBagLayout GridBagConstraints cnew GridBagConstraints Button b1b2 Label L1 final TextArea ta c.insetsnew Insets60000 L1new Labelquot 欢 迎 进 入信 息 浏 览 界 面 quot L1.setBackgroundColor.CYAN c.gridx0 c.gridy0 c.gridwidth0 c.gridheight1 p4.addL1c b1new Buttonquot 浏 览 quot b1.setBackgroundColor.CYAN c.gridx0 c.gridy10 c.gridwidth1 c.gridheight1 p4.addb1c b2new Buttonquot 返 回 quot b2.setBackgroundColor.CYAN c.gridx0 c.gridy20 c.gridwidth1 c.gridheight1 p4.addb2c ta new TextArea1550 c.gridx0 c.gridy11 c.gridwidth1 c.gridheight1 p4.addtac p4.setBackgroundColor.green f.addp4quotFourthquot b1.addMouseListenernew MouseAdapter public void mouseClickedMouseEvent e try Class.forNamequotcom.microsoft.sqlserver.jdbc.SQLServerDriverquot Stringurlquotjdbc:sqlserver://localhost:1433DatabaseNameemployeequot String userNamequotsaquot String passwordquotxhwquot ConnectionconnDriverManager.getConnectionurluserNamepassword Statement stmtconn.createStatement ResultSet rsstmt.executeQueryquotselect fromxhwquot employee em new employee10 int i0 whilers.next employee em1new employee em1.numrs.getStringquot工号quot em1.namers.getStringquot姓名quot em1.sexrs.getStringquot性别quot em1.agers.getStringquot年龄quot em1.edurs.getStringquot学历quot em1.slars.getStringquot工资quot em1.addrs.getStringquot住址quot em1.telrs.getStringquot电话quot emiem1 i String s quot工号t姓名t性别t年龄t学历t工资t住址t电话nquot forint j0jltij ssemj.numquottquotemj.namequottquotemj.sexquottquotemj.agequottquotemj.eduquottquotemj.slaquottquotemj.addquottquotemj.telquotnnquot ta.setTexts rs.close stmt.close catchException e1 e1.printStackTrace b2.addMouseListenernew MouseAdapter public void mouseClickedMouseEvent e ta.setTextquotquot myCard.showfquotSecondquot public void go5 p5new Panel p5.setLayoutnew GridBagLayout GridBagConstraints cnew GridBagConstraints c.insetsnew Insets40000 Panel p5_2new Panel p5_2.setLayoutnew GridBagLayout GridBagConstraints xnew GridBagConstraints x.insetsnew Insets3060080 Button b1b2b3b4 final TextField t1 final TextField t2 final TextArea ta Label L1 b1new Buttonquot 查 询 名 称 quot b1.setBackgroundColor.CYAN x.gridx0 x.gridy0 x.gridwidth2 x.gridheight1 p5_2.addb1x b2new Buttonquot 查 询 范 围 quot b2.setBackgroundColor.CYAN x.gridx0 x.gridy5 x.gridwidth2 x.gridheight1 p5_2.addb2x b3new Buttonquot 查 询 quot b3.setBackgroundColor.CYAN x.gridx0 x.gridy10 x.gridwidth2 x.gridheight1 p5_2.addb3x b4new Buttonquot 返 回 quot b4.setBackgroundColor.CYAN x.gridx20 x.gridy10 x.gridwidth1 x.gridheight1 p5_2.addb4x t1 new TextField10 x.gridx20 x.gridy0 x.gridwidth1 x.gridheight1 p5_2.addt1x t2new TextField10 x.gridx20 x.gridy5 x.gridwidth1 x.gridheight1 p5_2.addt2x L1new Labelquot 欢 迎 进 入职 工 信 息 查 询 界 面 quot L1.setBackgroundColor.CYAN c.gridx0 c.gridy0 c.gridwidth0 c.gridheight1 p5.addL1c c.gridx0 c.gridy5 c.gridwidth1 c.gridheight1 p.
上一篇:
开放源代码平台下基于Web的刀具数据管理系统
下一篇:
女人七种行为逼男人想离婚