好文档 - 专业文书写作范文服务资料分享网站

青岛理工JAVA实验5资料讲解

天下 分享 时间: 加入收藏 我要投稿 点赞

精品文档

void actionPerformed(ActionEvent e ) { try { ver); } catch (java.lang.ClassNotFoundException f) { System.out.println(\ame:\ try { Connection con } Class.forName(JDri s.executeQuery(CreateTable); s.close(); con.close(); } catch ( SQLException f) { System.out.println(\ssage()); try{ Connection con } =DriverManager.getConnection(conURL); Statement s=con.createStatement(); String find = \VALUES('\+ \\\+ t5.getText() + \ PreparedStatement =DriverManager.getConnection(conURL); Statement s=con.createStatement(); String CreateTable = \Student(Sno char(9), Sname char(10) , Class char(10), Age smallint, Sex char(2))\ps=con.prepareStatement(find); 收集于网络,如有侵权请联系管理员删除

精品文档

; ps.executeUpdate()a2=new JLabel(\修改后该学生姓名为:\s.close(); con.close(); } JTextField t2=new JTextField(10); JLabel catch ( SQLException f) { System.out.printlna3=new JLabel(\修改后该学生班级为:\ JTextField (\ssage()); } t3=new JTextField(10); JLabel a4=new JLabel(\修改后该学生年龄为:\ JTextField String ss=\输入成功!\ JOptionPane.showMet4=new JTextField(10); JLabel ssageDialog(null, ss); }); } } } a5=new JLabel(\修改后该学生性别为:\ JTextField class Update extends JFrame //修改指定学号学生信息 { JButton OK=new JButton (\确定\ JLabel t5=new JTextField(10); Update(){ super(\学生信息管理系统\ setLocation(400,40setSize(400,300); a1=new JLabel(\要修改的学号:\ JTextField 0); setLayout(null); t1=new JTextField(10); JLabel 收集于网络,如有侵权请联系管理员删除

精品文档

0); ; ,20); ; 0); ; ,40); ; 0); a3.setSize(130,20)a3.setLocation(0,6t2.setSize(200,20)t2.setLocation(130a2.setSize(130,20)a2.setLocation(0,4t1.setSize(200,20)t1.setLocation(130a1.setSize(130,20)a1.setLocation(0,2; t3.setLocation(130,60); ; 0); ; a4.setSize(130,20)a4.setLocation(0,8t3.setSize(200,20)t4.setLocation(130,80); ; t4.setSize(200,20)a5.setLocation(0,100); ; t5.setLocation(130a5.setSize(130,20),100); ; t5.setSize(200,20)收集于网络,如有侵权请联系管理员删除

精品文档

; OK.setSize(100,20)(\()); try { } OK.setLocation(200,150); add(a1); Connection con add(t1); add(a2); add(t2); =DriverManager.getConnection(conURL); add(a3); add(t3); add(a4); Statement s=con.createStatement(); String find = \= '\\t2.getText() + \= '\\t4.getText() + \'\WHERE Student.Sno = '\t1.getText() + \ PreparedStatement add(t4); add(a5); add(t5); add(OK); listen3(); } void listen3(){ OK.addActionListener(new ActionListener(){ public void actionPerformed(ActionEvent e ) { try { ver); catch (java.lang.ClassNotFoundException f) { System.out.println} Class.forName(JDrips=con.prepareStatement(find); ps.executeUpdate(); s.close(); con.close(); } catch ( SQLException f) 收集于网络,如有侵权请联系管理员删除

精品文档

{ System.out.printlnsetSize(300,200); 0); ); ); ; OK.setLocation(150OK.setSize(100,20)t.setLocation(0,70t.setSize(150,20); a.setLocation(0,50a.setSize(150,20); setLayout(null); setLocation(400,40(\ssage()); } String ss=\修改完成!\ JOptionPane.showMessageDialog(null, ss); }); } } } class Delete extends JFrame //删除指定学号学生信息 { JButton OK=new JButton (\确定\ JLabel a=new JLabel(\要删除的学生学号:\ JTextField ,100); add(a);add(t); t=new JTextField(10); Delete() { add(OK);listen4(); } super(\学生信息管理系统\ void listen4() { OK.addActionListen收集于网络,如有侵权请联系管理员删除

青岛理工JAVA实验5资料讲解

精品文档voidactionPerformed(ActionEvente){try{ver);}catch(java.lang.ClassNotFoundExceptionf){System.out.println(\ame:\try{Connectioncon}Class.forN
推荐度:
点击下载文档文档为doc格式
4r3c64ydj47g2499ip734mu7526k9200fmz
领取福利

微信扫码领取福利

微信扫码分享