package dao.Impl;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import model.PageBean;
import model.Score;
import model.ScoreCou;
import model.ScoreSum;
import dao.ScoreDao;
import db.DBCon;
public class ScoreDaoImpl implements ScoreDao {
private Score score = null;
private ScoreCou scoreCou = null;
private PageBean pageBean = null;
private ScoreSum scoreSum = null;
private DBCon dbCon = new DBCon();
public int addScore(Score score) {
String sql = "insert into score(stu_num,stu_name,stu_class,course_name,score_grade,major) values('"
+ score.getStuNum()
+ "','"
+ score.getStuName()
+ "','"
+ score.getStuClass()
+ "','"
+ score.getCourseName()
+ "',"
+ score.getScoreGrade() + ",'" + score.getMajor() + "')";
int rs = dbCon.query(sql);
return rs;
}
public int deleteScore(int scoreID) {
String sql = "delete from score where score_id=" + scoreID;
int rs = dbCon.query(sql);
return rs;
}
public int editCos(Score score) {
String sql = "update score set stu_num='" + score.getStuNum()
+ "',stu_name='" + score.getStuName() + "',stu_class='"
+ score.getStuClass() + "',course_name='"
+ score.getCourseName() + "',score_grade="
+ score.getScoreGrade() + ",major='" + score.getMajor()
+ "' where score_id=" + score.getScoreID();
int rs = dbCon.query(sql);
return rs;
}
public List findAll() {
List<Score> list = new ArrayList<Score>();
String sql = "select * from score";
ResultSet rs = dbCon.find(sql);
try {
while (rs.next()) {
int scoreID = rs.getInt("score_id");
String stuNum = rs.getString("stu_num");
String stuName = rs.getString("stu_name");
String stuClass = rs.getString("stu_class");
String courseName = rs.getString("course_name");
double scoreGrade = rs.getDouble("score_grade");
String major = rs.getString("major");
Score score = new Score(scoreID, stuNum, stuName, stuClass,
courseName, scoreGrade, major);
list.add(score);
}
} catch (SQLException e) {
e.printStackTrace();
}
return list;
}
public List findOne(String stuNum) {
List<ScoreCou> list = new ArrayList<ScoreCou>();
String sql = "select score.course_name,course_credit,course_hours,course_teacher,major,coursedate,score_grade "
+ "from score,course where score.course_name=course.course_name and stu_num='"
+ stuNum + "'";
ResultSet rs = dbCon.find(sql);
try {
while (rs.next()) {
String courseName = rs.getString("course_name");
int courseCredit = rs.getInt("course_credit");
int courseHours = rs.getInt("course_hours");
String courseTea = rs.getString("course_teacher");
String major = rs.getString("major");
Date courseDate = rs.getDate("coursedate");
double scoreGrade = rs.getDouble("score_grade");
ScoreCou scoreCou = new ScoreCou(courseName, courseCredit,
courseHours, courseTea, major, courseDate, scoreGrade);
list.add(scoreCou);
}
} catch (SQLException e) {
e.printStackTrace();
}
return list;
}
public List selectScore(int scoreID) {
List<Score> list = new ArrayList<Score>();
String sql = "select * from score where score_id=" + scoreID;
ResultSet rs = dbCon.find(sql);
try {
while (rs.next()) {
int scoreid = rs.getInt("score_id");
String stuNum = rs.getString("stu_num");
String stuName = rs.getString("stu_name");
String stuClass = rs.getString("stu_class");
String courseName = rs.getString("course_name");
double scoreGrade = rs.getDouble("score_grade");
String major = rs.getString("major");
Score score = new Score(scoreid, stuNum, stuName, stuClass,
courseName, scoreGrade, major);
list.add(score);
}
} catch (SQLException e) {
e.printStackTrace();
}
return list;
}
public Score selectScoreInfo(Score scor) {
String sql = "select * from score where stu_num='" + scor.getStuNum()
+ "' and course_name='" + scor.getCourseName() + "'";
ResultSet rs = dbCon.find(sql);
try {
while (rs.next()) {
int scoreid = rs.getInt("score_id");
String stuNum = rs.getString("stu_num");
String stuName = rs.getString("stu_name");
String stuClass = rs.getString("stu_class");
String courseName = rs.getString("course_name");
double scoreGrade = rs.getDouble("score_grade");
String major = rs.getString("major");
score = new Score(scoreid, stuNum, stuName, stuClass,
courseName, scoreGrade, major);
}
} catch (SQLException e) {
e.printStackTrace();
}
return score;
}
public PageBean scoreListPage(int pageNo, int pageCount, String stuNum) {
int totalCount = 0;
List<ScoreCou> list = new ArrayList<ScoreCou>();
String sql = "select score.course_name,course_credit,course_hours,course_teacher,major,coursedate,score_grade "
+ "from score,course where score.course_name=course.course_name and stu_num='"
+ stuNum
+ "' limit "
+ ((pageNo - 1) * pageCount)
+ ","
+ pageCount;
String sqlCount = "select count(*) from score,course where score.course_name=course.course_name and stu_num='"
+ stuNum + "'";
ResultSet rs = dbCon.find(sql);
try {
while (rs.next()) {
String courseName = rs.getString("course_name");
int courseCredit = rs.getInt("course_credit");
int courseHours = rs.getInt("course_hours");
String courseTea = rs.getString("course_teacher");
String major = rs.getString("major");
Date courseDate = rs.getDate("coursedate");
double scoreGrade = rs.getDouble("score_grade");
ScoreCou scoreCou = new ScoreCou(courseName, courseCredit,
courseHours, courseTea, major, courseDate, scoreGrade);
list.add(scoreCou);
}
rs = dbCon.find(sqlCount);
while (rs.next()) {
totalCount = rs.getInt(1);
}
pageBean = new PageBean(list, totalCount, pageNo, pageCount);
} catch (SQLException e) {
dbCon.close();
e.printStackTrace();
}
return pageBean;
}
public PageBean scoreListPage(int pageNo, int pageCount) {
int totalCount = 0;
List<Score> list = new ArrayList<Score>();
String sql = "select * from score limit " + ((pageNo - 1) * pageCount)
+ "," + pageCount;
String sqlCount = "select count(*) from score";
ResultSet rs = dbCon.find(sql);
try {
while (rs.next()) {
int scoreID = rs.getInt("score_id");
String stuNum = rs.getString("stu_num");
String stuName = rs.getString("stu_name");
String stuClass = rs.getString("stu_class");
String courseName = rs.getString("course_name");
double scoreGrade = rs.getDouble("score_grade");
String major = rs.getString("major");
score = new Score(scoreID, stuNum, stuName, stuClass,
courseName, scoreGrade, major);
list.add(score);
}
rs = dbCon.find(sqlCount);
while (rs.next()) {
totalCount = rs.getInt(1);
}
pageBean = new PageBean(list, totalCount, pageNo, pageCount);
} catch (SQLException e) {
dbCon.close();
e.printStackTrace();
}
return pageBean;
}
public List findStuOne(String stuNum, String courseName) {
List<ScoreCou> list = new ArrayList<ScoreCou>();
String sql = "select score.course_name,course_credit,course_hours,course_teacher,major,coursedate,score_grade "
+ "from score,course where score.course_name=course.course_name and stu_num='"
+ stuNum + "' and course.course_name='" + courseName + "'";
ResultSet rs = dbCon.find(sql);
try {
while (rs.next()) {
String coursename = rs.getString("course_name");
int courseCredit = rs.getInt("course_credit");
int courseHours = rs.getInt("course_hours");
String courseTea = rs.getString("course_teacher");
String major = rs.getString("major");
Date courseDate = rs.getDate("coursedate");
double scoreGrade = rs.getDouble("score_grade");
scoreCou = new ScoreCou(coursename, courseCredit, courseHours,
courseTea, major, courseDate, scoreGrade);
list.add(scoreCou);
}
} catch (SQLExcept
没有合适的资源?快使用搜索试试~ 我知道了~
java mysql j前端 学生成绩管理系统
共586个文件
class:168个
js:122个
java:84个
需积分: 15 0 下载量 163 浏览量
2022-07-21
12:23:47
上传
评论
收藏 6.49MB RAR 举报
温馨提示
这是一个由学生、教师、管理员三种不同类型用户所构建的学生成绩管理系统。这是一个相对比较完善的系统,学生端有相应的成绩查看,学生管理实现了简单的信息管理模块。 相对功能性比较多的是教师管理模块,在添加学生成绩时可以按照平时成绩和考试成绩自动计算学生总成绩。项目附带了我画的E-R图,功能模块图等等,相对功能比较完善。可以满足大学阶段的各种需求。
资源详情
资源评论
资源推荐
收起资源包目录
java mysql j前端 学生成绩管理系统 (586个子文件)
,CKEDITOR.tools.htmlEncode(e._[ 1KB
,CKEDITOR.tools.htmlEncode(e._[ 1KB
_div style= 1KB
_div style= 1KB
ScoreDaoImpl.class 11KB
ScoreDaoImpl.class 11KB
ServletUploadFile.class 6KB
ServletUploadFile.class 6KB
CourseDaoImpl.class 5KB
CourseDaoImpl.class 5KB
StudentDaoImpl.class 5KB
StudentDaoImpl.class 5KB
TeacherDaoImpl.class 5KB
TeacherDaoImpl.class 5KB
UserDaoImpl.class 4KB
UserDaoImpl.class 4KB
ServletDownloadFile.class 4KB
ServletDownloadFile.class 4KB
ServletaddTeacher.class 3KB
ServletaddTeacher.class 3KB
ServletaddStudent.class 3KB
ServletaddStudent.class 3KB
ScoreServiceImpl.class 3KB
ScoreServiceImpl.class 3KB
ServletaddScore.class 3KB
ServletaddScore.class 3KB
ServletRegistersStudent.class 3KB
ServletRegistersStudent.class 3KB
ServletaddCourse.class 3KB
ServletaddCourse.class 3KB
ServletLogin.class 3KB
ServletLogin.class 3KB
DBCon.class 3KB
DBCon.class 3KB
ServletEditCos.class 2KB
ServletEditCos.class 2KB
ServletListFile.class 2KB
ServletListFile.class 2KB
Teacher.class 2KB
Teacher.class 2KB
Student.class 2KB
Student.class 2KB
ServletTeaSearchScore.class 2KB
ServletTeaSearchScore.class 2KB
ServletSearchScore.class 2KB
ServletSearchScore.class 2KB
ServletTeaStuScore.class 2KB
ServletTeaStuScore.class 2KB
ServletEditTeacherInfo.class 2KB
ServletEditStudentInfo.class 2KB
ServletEditTeacherInfo.class 2KB
ServletEditStudentInfo.class 2KB
ServletEditScore.class 2KB
ServletEditScore.class 2KB
EmpBiz.class 2KB
EmpBiz.class 2KB
ServletEditTea.class 2KB
ServletEditTea.class 2KB
ServletEditStu.class 2KB
ServletEditStu.class 2KB
ServletFindStu.class 2KB
ServletFindStu.class 2KB
Score.class 2KB
Score.class 2KB
ServletFindStudentScore.class 2KB
ServletFindStudentScore.class 2KB
User.class 2KB
User.class 2KB
ServletEditPwd.class 2KB
ServletEditPwd.class 2KB
ScoreCou.class 2KB
ScoreCou.class 2KB
Course.class 2KB
Course.class 2KB
LoginFilter.class 2KB
LoginFilter.class 2KB
ServletEditUser.class 2KB
ServletEditUser.class 2KB
ScoreSum.class 2KB
ScoreSum.class 2KB
ServletStuSumList.class 2KB
ServletStuSumList.class 2KB
PageServlet.class 2KB
PageServlet.class 2KB
ServletInfo.class 2KB
ServletInfo.class 2KB
ServletFindAllStu.class 2KB
ServletFindAllStu.class 2KB
ServletFindAllScore.class 2KB
ServletFindAllScore.class 2KB
ServletTeaAllCos.class 2KB
ServletTeaAllCos.class 2KB
ServletSelectStudentInfo.class 2KB
ServletSelectStudentInfo.class 2KB
ServletFindAllCos.class 2KB
ServletFindAllCos.class 2KB
ServletStuSum.class 2KB
ServletStuSum.class 2KB
ServletOneStudentScore.class 2KB
ServletOneStudentScore.class 2KB
共 586 条
- 1
- 2
- 3
- 4
- 5
- 6
程序员不需要码子
- 粉丝: 41
- 资源: 2
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- 绿色便携版Python打包版
- Ngrok内网穿透启动隧道工具
- 异步电机matlab仿真模型
- BMS电池管理控制器,开发板资料 电池管理系统策略开发,应用层软件,开发流程开发
- 基于Transformer的各种变体已经是时间序列以及多元时间序列的一大热点,自注意力机制以及多头自注意力机制本团队已经可以基于matlab平台实现
- 基于自适应在线学习的概率负荷预测(代码)
- 出基于滑模的永磁直线同步电机的鲁棒H无穷控制Matlab程序,对于学习SMC和H无穷的结合可以很好参考
- COMSOL 孔隙尺度渗流模拟,单相及多相渗流模拟,案例复现,水平集(LS)和相场(PF)实现两相流模拟,水驱油,水驱气,二氧化碳驱油等模拟
- 可三相LCL型并网逆变器仿真模型,LCL滤波器,电容电流反馈有源阻尼方法 只采用网侧电流环控制方法时,由于系统的固有谐振峰的存在,以及数字控制延时的影响,通常延时时间 Td=1.5Ts(Ts
- 联电SOA软件平台:基于MATLAB/Simulink加速汽车软件开发生态建设与实现
- 柴油发电机仿真 Matlab Simulink 柴油发电机matlab仿真 微电网仿真 柴油发电仿真 风光柴储微电网 光伏发电 柴油发电 风力发电 储能电池 光柴储微电网 风柴储微电网 风机光伏柴油
- IEEE Access模板
- V2G 充电桩,新能源汽车车载充电机, MATLAB仿真模型 ,PFC+CLLC拓扑; 1. V2G,AC DC,DC DC双向充放电; 2. 前级,双向AC DC单相整流器(PWM),输入AC
- ARM发布Armv9.5架构:迈向更强性能与灵活性的新时代
- 汽车行业面向服务架构(SOA)下传统应用向软件定义汽车(SDV)的迁移方案及挑战
- 西门子1200恒压供水程序+PID+触摸屏 此程序样 例为 一拖三恒压供水程序样,S7-1200PLC和KTP1000PN触摸屏 人机执行PID控制变频器实现恒压供水. 供学习参考,用15
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功
评论0