admin 管理员组文章数量: 1086019
2024年1月15日发(作者:tcpip与osi模型对应)
nds(425,400,80,60); nds(285,350,60,40); (a1); (b1); (a2); (b2); (a3); (b3); (a4); (b4); (a5); (b5); (a6); (b6); (a); (b); (c); (d); (e); (area); //add(contentPane); ionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { Object obj = rce(); if (obj == a) ; method1(); try { 2(); } catch (ClassNotFoundException ex) { tackTrace(); } catch (SQLException ex) { tackTrace(); } ssageDialog(a,"添加信息成功"); } }); ionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { Object obj = rce(); if (obj == b) ; method2(); try { 3(); } catch (ClassNotFoundException ex) { tackTrace(); } catch (SQLException ex) { tackTrace(); } ssageDialog(b,"删除信息成功"); } });
} } } } public static void method3()throws ClassNotFoundException, SQLException{ try { e(""); String url = "jdbc:mysql://localhost:3306/school?useUnicode=true&characterEncoding=utf8&useSSL=true"; String user = "root"; String password = "123456"; Connection connection = nection(url, user, password); String sql = "delete from `stuSystem` where `学号`= '" + a16 + "' "; Statement statement = Statement(); eUpdate(sql); }catch (ClassNotFoundException e) { tackTrace(); } catch (SQLException throwables) { tackTrace(); }finally { if (statement != null) { try { (); } catch (SQLException throwables) { tackTrace(); } } if (connection != null) { try { (); } catch (SQLException throwables) { tackTrace(); } } } } public static void method4()throws ClassNotFoundException, SQLException{ try { e(""); String url = "jdbc:mysql://localhost:3306/school?useUnicode=true&characterEncoding=utf8&useSSL=true"; String user = "root"; String password = "123456"; Connection connection = nection(url, user, password); Statement statement = Statement(); ResultSet resultSet = eQuery("select * from stuSystem where `学号`="+a17); while (()) { String idnumber = ing("学号"); String name = ing("姓名"); String age = ing("年龄"); String home = ing("祖籍"); String apartment = ing("学院"); String gradeclass = ing("班级"); t(name); t(age); t(home); t(idnumber); t(apartment);
t(apartment); t(gradeclass); } } catch (ClassNotFoundException e) { tackTrace(); } catch (SQLException throwables) { tackTrace(); }finally { if (resultSet != null) { try { (); } catch (SQLException throwables) { tackTrace(); } } if (statement != null) { try { (); } catch (SQLException throwables) { tackTrace(); } } if (connection != null) { try { (); } catch (SQLException throwables) { tackTrace(); } } } } public static void method5() throws ClassNotFoundException, SQLException{ try{ e(""); String url = "jdbc:mysql://localhost:3306/school?useUnicode=true&characterEncoding=utf8&useSSL=true"; String user = "root"; String password = "123456"; Connection connection = nection(url, user, password); String sql = "update stuSystem set `姓名`= '"+ t() +"',`年龄` = '" + t()+ "',`祖籍` = '"+ t()+"', `学院` = '"+ t()+ "',`班级` = '"+ t()+"' where `学号`='"+ t()+"'"; Statement statement = Statement(); eUpdate(sql); } catch (ClassNotFoundException e) { tackTrace(); } catch (SQLException throwables) { tackTrace(); }finally { if (resultSet != null) { try { (); } catch (SQLException throwables) { tackTrace(); } } if (statement != null) { try { (); } catch (SQLException throwables) {
版权声明:本文标题:Java项目(案例)与数据库建立连接,实现可视化的学生信息管理系统 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.roclinux.cn/b/1705272144a479261.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论