JAVA课程设计包括全部源代码
面向对象课程设计报告 第 12 页,共 19 页 String s2 = JOptionPane.showInputDialog("请输入出生日期"); try { con = DriverManager.getConnection("jdbc:odbc:tuanyuan", "", ""); sql = con.createStatement(); sql.executeUpdate("UPDATE tuanyuanxinxi SET 出生日期 = " + "'"+s2+"'" + " WHERE 姓名 LIKE" + "'" + s1 + "'"); rs = sql .executeQuery("SELECT * FROM tuanyuanxinxi WHERE 姓 名 LIKE " + "'" + s1 + "'"); while (rs.next()) { 获取信息:姓名、班级、学号、性别、出生日期、入团时间、联系方式、家庭住址; 输出至文本区:姓名、班级、学号、性别、出生日期、入团时间、联系方式、家庭住址; } con.close(); sql.close(); } catch (SQLException e2) { System.out.println(e2); } } else if (e.getSource() == b6) { String s1 = ta2.getText(); String s2 = JOptionPane.showInputDialog("请输入入团时间"); try { con = DriverManager.getConnection("jdbc:odbc:tuanyuan", "", ""); sql = con.createStatement(); sql.executeUpdate("UPDATE tuanyuanxinxi SET 入团时间 = " + "'"+s2+"'" + " WHERE 姓名 LIKE" + "'" + s1 + "'"); rs = sql .executeQuery("SELECT * FROM tuanyuanxinxi WHERE 姓 名 LIKE " + "'" + s1 + "'"); while (rs.next()) { 获取信息:姓名、班级、学号、性别、出生日期、入团时间、联系方式、家庭住址; 输出至文本区:姓名、班级、学号、性别、出生日期、入团时间、联系方式、家庭住址; } con.close(); sql.close(); } catch (SQLException e2) { System.out.println(e2); } } else if (e.getSource() == b7) { String s1 = ta2.getText(); String s2 = JOptionPane.showInputDialog("请输入联系方式"); try { con = DriverManager.getConnection("jdbc:odbc:tuanyuan", "", "");