资源描述:
《java 职工信息管理系统源代码》由会员上传分享,免费在线阅读,更多相关内容在教育资源-天天文库。
1、源代码packagelesson2;importjava.sql.*;publicclassemployee{publicStringnum;publicStringname;publicStringsex;publicStringage;publicStringedu;publicStringsla;publicStringadd;publicStringtel;publicvoidinit(Stringx1,Stringx2,Stringx3,Stringx4,Stringx5,Stringx6,Stringx7,Stringx8){num=x1;name=x2;sex=x3;
2、age=x4;edu=x5;sla=x6;add=x7;tel=x8;}publicvoidload(Stringf){try{Class.forName("com.microsoft.sqlserver.jdbc.SQLServerDriver");Stringurl="jdbc:sqlserver://localhost:1433;DatabaseName=employee";StringuserName="sa";Stringpassword="xhw";Connectionconn=DriverManager.getConnection(url,userName,passw
3、ord);if(conn!=null)System.out.println("已成功地与SQLServer2005数据库建立连接!");Statementstmt=conn.createStatement();stmt.executeUpdate(f);stmt.close();}catch(Exceptione){e.printStackTrace();}}}packagelesson2;importjava.awt.*;importjava.awt.event.*;importjava.sql.*;publicclasslesson2_1{staticFramef;CardLa
4、youtmyCard;Panelp1;Panelp2;Panelp3;Panelp4;Panelp5;Panelp6;Panelp7;Panelp8;publicstaticvoidmain(String[]args){lesson2_1test=newlesson2_1();test.go1();test.go2();test.go3();test.go4();test.go5();test.go6();test.go7();test.go8();}publicvoidgo1(){f=newFrame("呵呵!!!");myCard=newCardLayout();f.setLa
5、yout(myCard);p1=newPanel();Buttonb1,b2,b3;LabelL1;TextFieldte1;finalTextFieldte2;p1.setLayout(newGridBagLayout());GridBagConstraintsc=newGridBagConstraints();Panelp1_1=newPanel();p1_1.setLayout(newGridBagLayout());GridBagConstraintsx=newGridBagConstraints();b1=newButton("请输入用户名");b1.setBackgro
6、und(Color.CYAN);x.insets=newInsets(50,50,50,50);x.gridx=0;x.gridy=0;x.gridwidth=1;x.gridheight=1;p1_1.add(b1,x);b2=newButton("请输入密码");b2.setBackground(Color.CYAN);x.gridx=0;x.gridy=5;x.gridwidth=1;x.gridheight=1;p1_1.add(b2,x);te1=newTextField(15);c.insets=newInsets(40,0,40,0);x.gridx=5;x.grid
7、y=0;x.gridwidth=1;x.gridheight=1;p1_1.add(te1,x);te2=newTextField(15);x.gridx=5;x.gridy=5;x.gridwidth=1;x.gridheight=1;p1_1.add(te2,x);L1=newLabel("**********欢迎进入职工管理系统**************");L1.setBackground(Color.CYAN);c.gridx=0;c.gridy=0;c.