connDB(); int rs1 = stmt.executeUpdate("delete from c o='" + kch + "'"); } catch (SQLException e){ e.printStackTrace();}} String str= "insert into c values('" + kch + "','" + kcm + "','" + xxkch + "')"; this.connDB();// 连接数据库 try {stmt.executeUpdate(str); JOptionPane.showMessageDialog(null, this.getTitle() +" 成功! ", " 提示", JOptionPane.INFORMATION_MESSAGE, new ImageIcon( "menu4.gif")); this.setVisible(false); } catch (SQLException e){ JOptionPane.showMessageDialog(null, " 课程号已存在! "); tcno.setText("");} } public void actionPerformed(ActionEvent e){ if (e.mand() == " 确定"){ this.insertst(); if (isNewsm) { new CM(" 课程信息管理").display(); } isNewsm = true; } if (e.mand() == " 取消"){ this.setVisible(false); new CM(" 课程信息管理").display(); } }} class CM extends JFrame implements ActionListener {// 课程信息管理