package Bean;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
import java.util.ArrayList;
import javax.servlet.http.HttpServletRequest;
public class ScoreBean {
String sid="";
String sname="";
String tnumber="";
String tsubject="";
String score="";
public String getSid() {
return sid;
}
public void setSid(String sid) {
this.sid = sid;
}
public String getTnumber() {
return tnumber;
}
public void setTnumber(String tnumber) {
this.tnumber = tnumber;
}
public String getScore() {
return score;
}
public void setScore(String score) {
this.score = score;
}
public String getSname() {
return sname;
}
public void setSname(String sname) {
this.sname = sname;
}
public String getTsubject() {
return tsubject;
}
public void setTsubject(String tsubject) {
this.tsubject = tsubject;
}
public void userCheck(String id,String number)
{
try {
DBConnectBean connect = new DBConnectBean();
Connection conn = connect.getConnect();
Statement st= conn.createStatement();
ResultSet rs=null;
String sql="select s_test.sid,tnumber,score,student.name,test.subject from student,test,s_test where student.id=s_test.sid and test.number=s_test.tnumber and s_test.sid='"+id+"'and s_test.tnumber='"+number+"'";
rs = st.executeQuery(sql);
while(rs.next())
{
sid=rs.getString(1);
sname=rs.getString(4);
tnumber=rs.getString(2);
tsubject=rs.getString(5);
score=rs.getString(3);
}
} catch (SQLException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
public ArrayList<ScoreBean> scoreform()
{
ArrayList<ScoreBean> all = new ArrayList<ScoreBean>();
try {
DBConnectBean connect = new DBConnectBean();
Connection conn = connect.getConnect();
ResultSet rs=null;
String sql="select s_test.sid,tnumber,student.name,test.subject from student,test,s_test where s_test.sid=student.id and s_test.tnumber=test.number";
PreparedStatement ps = conn.prepareStatement(sql);
rs = ps.executeQuery();
while (rs.next()) {
ScoreBean score=new ScoreBean();
score.setSid(rs.getString(1));
score.setSname(rs.getString(3));
score.setTnumber(rs.getString(2));
score.setTsubject(rs.getString(4));
all.add(score);
}
} catch (SQLException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
return all;
}
public ScoreBean scoreform(ScoreBean sco, String scores) {
ScoreBean score=new ScoreBean();
try {
DBConnectBean connect = new DBConnectBean();
Connection conn = connect.getConnect();
ResultSet rs=null;
String sid=sco.getSid();
String tnumber=sco.getTnumber();
Statement st = conn.createStatement();
String sql="select sid,tnumber from s_test where sid='"+sid+"'and tnumber='"+tnumber+"'";
PreparedStatement ps = conn.prepareStatement(sql);
System.out.println("检测:函数开始调用");
rs = ps.executeQuery();
if(!rs.next())
{
String sql2="select s_test.sid,tnumber,score,student.id,name,test.number,subject from student,test,s_test where s_test.sid=student.id and s_test.tnumber=test.number and student.id='"+sid+"'and test.number='"+tnumber+"'";
ps = conn.prepareStatement(sql2);
rs = ps.executeQuery();
while(rs.next())
{
System.out.println("检测:执行");
//System.out.println(rs.getString(1));
score.setSid(rs.getString(1));
score.setSname(rs.getString(5));
score.setTnumber(rs.getString(2));
score.setTsubject(rs.getString(7));
//System.out.println(rs.getString(1));
//System.out.println("insert into score values('"+rs.getString(1)+"','"+rs.getString(2)+"','"+rs.getString(3)+"','"+scores+"')");
String sql3="insert into s_test values('"+rs.getString(1)+"','"+rs.getString(2)+scores+"')";
st.executeUpdate(sql3);
}
}
else{
System.out.println("此学生该科目成绩已存在");
rs = ps.executeQuery();
}
String sql1 = "select s_test.sid,tnumber,student.name,test.subject from student,test,s_test where s_test.sid=student.id and s_test.tnumber=test.number and s_test.sid="+sid+"'";
ps = conn.prepareStatement(sql1);
rs = ps.executeQuery();
while (rs.next()) {
score.setSid(rs.getString(1));
score.setSname(rs.getString(2));
score.setTnumber(rs.getString(3));
score.setTsubject(rs.getString(3));
score.setScore(rs.getString(4));
}
} catch (SQLException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
return score;
}
//所有学生成绩表单
public ArrayList<ScoreBean> scoreform1()
{
ArrayList<ScoreBean> all = new ArrayList<ScoreBean>();
try {
DBConnectBean connect = new DBConnectBean();
Connection conn = connect.getConnect();
ResultSet rs=null;
String sql = "select s_test.sid,tnumber,score,student.name,test.subject from student,test,s_test where s_test.sid=student.id and s_test.tnumber=test.number";
PreparedStatement ps = conn.prepareStatement(sql);
rs = ps.executeQuery();
while (rs.next()) {
ScoreBean score=new ScoreBean();
score.setSid(rs.getString(1));
score.setSname(rs.getString(4));
score.setTnumber(rs.getString(2));
score.setTsubject(rs.getString(5));
score.setScore(rs.getString(3));
all.add(score);
}
} catch (SQLException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
return all;
}
public ScoreBean scoreform(String sid,String tnumber) {
ScoreBean score=new ScoreBean();
try {
DBConnectBean connect = new DBConnectBean();
Connection conn = connect.getConnect();
ResultSet rs=null;
System.out.println(sid);
String sql = "select s_test.sid,tnumber,score,student.name,test.subject from student,test,s_test where s_test.sid=student.id and s_test.tnumber=test.number and s_test.sid='"+sid+"'and s_test.tnumber='"+tnumber+"'";
PreparedStatement ps = conn.prepareStatement(sql);
rs = ps.executeQuery();
while (rs.next()) {
score.setSid(rs.getString(1));
score.setSname(rs.getString(4));
score.setTnumber(rs.getString(2));
score.setTsubject(rs.getString(5));
score.setScore(rs.getString(3));
}
} catch (SQLException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
return score;
}
public void updateScore(HttpServletRequest request,String sid,String tnumber) {
DBConnectBean connect = new DBConnectBean();
Connection conn = connect.getConnect();
String sql = "update s_test set score = '" + request.getParameter("score")+"'where sid = '"+ sid + "'and tnumber='"+tnumber+"'";
try {
Statement st = conn.createStatement();
st.executeUpdate(sql);
//dc.con.close();
} catch (SQLException e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
}
}
}
没有合适的资源?快使用搜索试试~ 我知道了~
java web项目 servlet+jsp实现的网上在线报名系统.zip
共90个文件
jsp:33个
java:20个
class:20个
1.该资源内容由用户上传,如若侵权请联系客服进行举报
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
版权申诉
5星 · 超过95%的资源 1 下载量 8 浏览量
2023-06-30
14:20:59
上传
评论 1
收藏 1.17MB ZIP 举报
温馨提示
本资源中的源码都是经过本地编译过可运行的,下载后按照文档配置好环境就可以运行。资源项目的难度比较适中,内容都是经过助教老师审定过的,应该能够满足学习、使用需求,如果有需要的话可以放心下载使用。有任何问题也可以随时私信博主,博主会第一时间给您解答!!! 本资源中的源码都是经过本地编译过可运行的,下载后按照文档配置好环境就可以运行。资源项目的难度比较适中,内容都是经过助教老师审定过的,应该能够满足学习、使用需求,如果有需要的话可以放心下载使用。有任何问题也可以随时私信博主,博主会第一时间给您解答!!! 本资源中的源码都是经过本地编译过可运行的,下载后按照文档配置好环境就可以运行。资源项目的难度比较适中,内容都是经过助教老师审定过的,应该能够满足学习、使用需求,如果有需要的话可以放心下载使用。有任何问题也可以随时私信博主,博主会第一时间给您解答!!!本资源中的源码都是经过本地编译过可运行的,下载后按照文档配置好环境就可以运行。资源项目的难度比较适中,内容都是经过助教老师审定过的,应该能够满足学习、使用需求,如果有需要的话可以放心下载使用。有任何问题也可以随时私信博主,博主会第一时间给您解
资源推荐
资源详情
资源评论
收起资源包目录
java web项目 servlet+jsp实现的网上在线报名系统.zip (90个子文件)
pro_content
Registration
.classpath 753B
.settings
org.eclipse.wst.jsdt.ui.superType.name 6B
org.eclipse.jdt.core.prefs 357B
.jsdtscope 555B
org.eclipse.wst.common.component 492B
org.eclipse.wst.ws.service.policy.prefs 85B
org.eclipse.wst.common.project.facet.core.xml 296B
org.eclipse.wst.jsdt.ui.superType.container 49B
src
Bean
UserLoginBean.java 5KB
StudentMessageBean.java 4KB
CheckBean.java 5KB
DBConnectBean.java 721B
TestBean.java 5KB
ScoreBean.java 7KB
AdminLoginBean.java 1KB
Servlet
AdminCheckTestServlet.java 2KB
AdminCheckScoreServlet.java 3KB
ScoreUpdateServlet.java 2KB
UserCheckScoreServlet.java 2KB
AdminEnterScoreServlet.java 3KB
AdminLoginServlet.java 2KB
AdminUpdateServlet.java 2KB
UserLoginServlet.java 3KB
AdminUpdateScoreServlet.java 2KB
AdminCheckMessageServlet.java 2KB
AdminUpdateTestServlet.java 2KB
UserRegisterServlet.java 2KB
AdminInsertTestServlet.java 2KB
build
classes
Bean
AdminLoginBean.class 2KB
ScoreBean.class 7KB
DBConnectBean.class 1KB
StudentMessageBean.class 4KB
UserLoginBean.class 6KB
TestBean.class 6KB
CheckBean.class 5KB
Servlet
UserLoginServlet.class 3KB
AdminLoginServlet.class 2KB
AdminEnterScoreServlet.class 3KB
AdminCheckScoreServlet.class 3KB
AdminUpdateServlet.class 2KB
AdminUpdateTestServlet.class 2KB
AdminCheckMessageServlet.class 3KB
UserCheckScoreServlet.class 3KB
AdminCheckTestServlet.class 3KB
AdminInsertTestServlet.class 3KB
UserRegisterServlet.class 3KB
ScoreUpdateServlet.class 2KB
AdminUpdateScoreServlet.class 3KB
WebContent
UserCheckScore.jsp 1KB
AdminAccurateCheck.jsp 3KB
AdminCheckTest.jsp 2KB
AdminUpdateScore.jsp 3KB
UserTest.jsp 3KB
UserRegisterSuccess.jsp 1KB
picture
1.jpg 205KB
timg.gif 16KB
3.jpg 8KB
AdminInsertTest.jsp 3KB
AdminCheckScore.jsp 2KB
WEB-INF
lib
postgresql-42.1.1.jar 696KB
commons-fileupload-1.2.jar 52KB
commons-beanutils.jar 184KB
commons-io-1.3.jar 82KB
index.jsp 725B
UserSelect.jsp 2KB
UserTestError.jsp 1KB
AdminFillInScore.jsp 3KB
UserTestSelect.jsp 1KB
UserLogin.jsp 2KB
AdminCheckTestError.jsp 1KB
AdminAlterScore.jsp 3KB
UserScoreMessage.jsp 2KB
AdminStuMessage.jsp 2KB
AdminLogin.jsp 2KB
AdminAlterMessage.jsp 3KB
AdminTestMessage.jsp 2KB
Admin.jsp 2KB
AdminUpdateMessage.jsp 3KB
AdminCheckError.jsp 1KB
AdminCheckMessage.jsp 2KB
UserRegister.jsp 2KB
AdminLoginError.jsp 1KB
UserTestSuccess.jsp 1KB
AdminAlterTest.jsp 3KB
UserLoginError.jsp 1KB
CheckError.jsp 1KB
META-INF
MANIFEST.MF 36B
AdminScore.jsp 3KB
AdminUpdateTest.jsp 3KB
.project 885B
共 90 条
- 1
资源评论
- jiarenkai2024-06-08资源内容详实,描述详尽,解决了我的问题,受益匪浅,学到了。
白话机器学习
- 粉丝: 1w+
- 资源: 7671
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- windows server 2019 安装net franework3.5.,添加功能-勾选3.5-确认步骤【指定备用源路径】,指定解压后路径,即可成功安装
- win10/win11均可使用
- 二甲基pep基于双光子激发细胞成像中的DNA探针设计
- java校园二手市场源码带本地搭建教程数据库 MySQL源码类型 WebForm
- 后端框架使用Django开发,数据库使用:Sql Server,前端使用Django模板,实现管理员对用户信息的增删改查,图书的增删改查,借阅管理,数据库日志查看,用户可以浏览图书信息,加入书架
- SQLServer-2022-Editions-datasheet.pdf
- EN-US-CNTNT-white-paper-DBMod-Microsoft-SQL-Server-2019-Technical-white-paper.pdf
- 基于Python+Django的交友系统,包括功能发布动态,私信聊天,发起活动,发表评论等
- Python毕业设计基于知识图谱的大学生能力评价与职位推荐系统源码(高分项目)
- java教师教学质量评价管理系统源码数据库 MySQL源码类型 WebForm
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功