数据库课程设计--班级事务管理系统内容摘要:

Connection conn。 try PreparedStatement ps select * from sc。 ResultSet rs。 while ScBean scb new ScBean。 id。 uid。 cid。 sgrade。 scb。 catch SQLException e。 finally try。 catch SQLException e。 return list。 public int deleteScInfo int id Connection conn。 ScBean lb null。 int flag 0。 try PreparedStatement ps delete from sc where id ?。 1, id。 flag。 catch SQLException e。 finally try。 catch SQLException e。 return flag。 public int addScInfo ScBean ub int flag 0。 Connection conn。 PreparedStatement ps。 try ps insert into sc uid,cid,sgrade values ?,?,?。 1,。 2,。 3,。 flag。 catch SQLException e。 return flag。 查询、添加、删除 程序代码说明: package。 import ection。 import aredStatement。 import ltSet。 import xception。 import edList。 import。 import .CoursBean。 import .ScBean。 import .DBConnection。 public class CourseDao public List queryAllCourse List list new LinkedList。 Connection conn。 try PreparedStatement ps select * from course。 ResultSet rs。 while CoursBean scb new CoursBean。 id。 ame。 ccredit。 cteacher。 scb。 catch SQLException e。 finally try。 catch SQLException e。 return list。 public int deleteCourseInfo int id Connection conn。 ScBean lb null。 int flag 0。 try PreparedStatement ps delete from course where id ?。 1, id。 flag。 catch SQLException e。 finally try。 catch SQLException e。 return flag。 public int addCourseInfo CoursBean cb int flag 0。 Connection conn。 PreparedStatement ps。 try ps insert into course ame,ccredit,cteacher values ?,?,?。 1,。 2,。 3,。 flag。 catch SQLException e。 return flag。 .学生详细信息的查询、添加、删除 程序代码说明: package。 import ection。 import aredStatement。 import ltSet。 import xception。 import edList。 import。 import .StuInfoBean。 import .DBConnection。 public class StuInfoDao public List queryAllStuInfo List list new LinkedList。 Connection conn。 try PreparedStatement ps select * from stuinfo。 ResultSet rs。 while StuInfoBean sfb new StuInfoBean。 id。 stuid。 stubirth。 stuidentity。 stuaddr。 studorm。 stucard。 sfb。 catch SQLException e。 finally try。 catch SQLException e。 return list。 //管理员删除学生详细信息 public int deleteStuInfo int id Connection conn。 StuInfoBean lb null。 int flag 0。 try。
阅读剩余 0%
本站所有文章资讯、展示的图片素材等内容均为注册用户上传(部分报媒/平媒内容转载自网络合作媒体),仅供学习参考。 用户通过本站上传、发布的任何内容的知识产权归属用户或原始著作权人所有。如有侵犯您的版权,请联系我们反馈本站将在三个工作日内改正。