900字范文,内容丰富有趣,生活中的好帮手!
900字范文 > Java课程设计---浏览学生(实现根据姓名查询)

Java课程设计---浏览学生(实现根据姓名查询)

时间:2018-10-20 19:06:19

相关推荐

Java课程设计---浏览学生(实现根据姓名查询)

1、修改窗口

2、在StudentDao中增加根据姓名查找的方法

public List<Student> getStudent(String name)throws SQLException{DbUtil dbUtil = new DbUtil();String sql="select * from tb_student where name LIKE \"+name+"%\";System.out.println(sql);List<Student> list = new ArrayList<Student>();ResultSet rs=dbUtil.executeQuery(sql);while(rs.next()){Student student = new Student();student.setId(rs.getInt("id"));student.setName(rs.getString("name"));student.setSex(rs.getString("sex"));s

本内容不代表本网观点和政治立场,如有侵犯你的权益请联系我们处理。
网友评论
网友评论仅供其表达个人看法,并不表明网站立场。